aboutsummaryrefslogtreecommitdiff
path: root/test/Frontend/verify2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Frontend/verify2.c')
-rw-r--r--test/Frontend/verify2.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/Frontend/verify2.c b/test/Frontend/verify2.c
index 73eda4d815de..075a2ab6e0f0 100644
--- a/test/Frontend/verify2.c
+++ b/test/Frontend/verify2.c
@@ -14,7 +14,26 @@
// CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
// CHECK-NEXT: error: 'error' diagnostics seen but not expected:
-// CHECK-NEXT: Line 1: header
+// CHECK-NEXT: Line 5: header
// CHECK-NEXT: Line 10: source
// CHECK-NEXT: 3 errors generated.
#endif
+
+#ifdef CHECK2
+// RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
+
+// The following checks that -verify can match "any line" in an included file.
+// The location of the diagnostic need therefore only match in the file, not to
+// a specific line number. This is useful where -verify is used as a testing
+// tool for 3rd-party libraries where headers may change and the specific line
+// number of a diagnostic in a header is not important.
+
+// expected-error@verify2.h:* {{header}}
+// expected-error@verify2.h:* {{unknown}}
+
+// CHECK2: error: 'error' diagnostics expected but not seen:
+// CHECK2-NEXT: File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:32): unknown
+// CHECK2-NEXT: error: 'error' diagnostics seen but not expected:
+// CHECK2-NEXT: File {{.*}}verify2.c Line 10: source
+// CHECK2-NEXT: 2 errors generated.
+#endif