diff options
Diffstat (limited to 'test/Parser/pragma-fp-contract.c')
-rw-r--r-- | test/Parser/pragma-fp-contract.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Parser/pragma-fp-contract.c b/test/Parser/pragma-fp-contract.c new file mode 100644 index 0000000..568c0a0 --- /dev/null +++ b/test/Parser/pragma-fp-contract.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void f1(void) { + int x = 0; +/* expected-error@+1 {{'#pragma fp_contract' should only appear at file scope or at the start of a compound expression}} */ +#pragma STDC FP_CONTRACT ON +} + +void f2(void) { + #pragma STDC FP_CONTRACT OFF + #pragma STDC FP_CONTRACT ON +} |