diff options
Diffstat (limited to 'test/PCH/different-diagnostic-level.c')
-rw-r--r-- | test/PCH/different-diagnostic-level.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/PCH/different-diagnostic-level.c b/test/PCH/different-diagnostic-level.c new file mode 100644 index 0000000000..ac1a0daab1 --- /dev/null +++ b/test/PCH/different-diagnostic-level.c @@ -0,0 +1,17 @@ +// RUN: %clang -x c-header %s -Weverything -o %t.h.pch +// RUN: %clang -x c %s -w -include %t.h -fsyntax-only -Xclang -verify + +#ifndef HEADER +#define HEADER + +extern int foo; + +#else + +void f() { + int a = foo; + // Make sure we parsed this by getting an error. + int b = bar; // expected-error {{undeclared}} +} + +#endif |