diff options
Diffstat (limited to 'test/PCH/pragma-once.c')
-rw-r--r-- | test/PCH/pragma-once.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/PCH/pragma-once.c b/test/PCH/pragma-once.c new file mode 100644 index 000000000000..15e8503c1158 --- /dev/null +++ b/test/PCH/pragma-once.c @@ -0,0 +1,13 @@ +// Test this without pch. +// RUN: %clang_cc1 -include %S/Inputs/pragma-once.h -fsyntax-only -verify %s + +// Test with pch. +// RUN: %clang_cc1 -emit-pch -o %t %S/Inputs/pragma-once.h +// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s + +// expected-no-diagnostics + +// Including "pragma-once.h" twice, to verify the 'once' aspect is honored. +#include "Inputs/pragma-once.h" +#include "Inputs/pragma-once.h" +int foo(void) { return 0; } |