================
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+a() {struct b c (sizeof(b * [({ {tree->d* next)} 0
+
+// expected-error@3 {{a type specifier is required for all declarations}}
+// expected-error@3 {{use of undeclared identifier 'tree'; did you mean
'true'?}}
+// expected-error@3 {{member reference type 'bool' is not a pointer}}
+// expected-error@3 {{expected ';' after expression}}
+// expected-error@3 {{use of undeclared identifier 'next'; did you mean
'new'?}}
+// expected-error@3 {{expected expression}}
+// expected-error@3 {{expected ';' after expression}}
+// expected-error@26 {{expected '}'}}
+// expected-note@3 {{to match this '{'}}
+// expected-error@26 {{expected ')'}}
+// expected-note@3 {{to match this '('}}
+// expected-error@26 {{expected ']'}}
+// expected-note@3 {{to match this '['}}
+// expected-error@26 {{expected ')'}}
+// expected-note@3 {{to match this '('}}
+// expected-error@3 {{using declaration 'exp' instantiates to an empty pack}}
+// expected-error@3 {{variable has incomplete type 'struct b'}}
+// expected-note@3 {{forward declaration of 'b'}}
+// expected-error@3 {{expected ';' at end of declaration}}
+// expected-error@26 {{expected '}'}}
+// expected-note@3 {{to match this '{'}}
+// expected-warning@3 {{expression result unused}}
----------------
AaronBallman wrote:
In most scenarios, we really do want to use `-verify` to see what the
diagnostic behavior is because we want it to be very obvious when diagnostic
behavior needs to be improved. (Similar for `-emit-llvm` when doing codegen
tests.) However, we only care about the behavior of code that a real user is
likely to write, which is not typical for fuzzer-generated crashing issues. I
think it would be useful to have a special `-verify` mode that ignores all
diagnostics (whether any are generated or not) and only tests that there was
not a crash. Something like `// expected-no-crash` and we diagnose if any other
`// expected-whatever` comments appear anywhere in the file. That should make
it more clear "we're not interested in behavior beyond not crashing" for anyone
reading the test.
https://github.com/llvm/llvm-project/pull/112111
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits