|
1 |
| -// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s |
| 1 | +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -triple x86_64 -DSUPPORTED %s |
| 2 | +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -triple armv7 %s |
| 3 | +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -triple armv7 -target-feature +bf16 -DSUPPORTED %s |
| 4 | + |
| 5 | +#ifdef SUPPORTED |
| 6 | + |
2 | 7 | __bf16 a = 1.b; // expected-error{{invalid suffix 'b' on floating constant}}
|
3 | 8 | __bf16 b = 1.bf; // expected-error{{invalid suffix 'bf' on floating constant}}
|
4 | 9 | __bf16 c = 1.bf166; // expected-error{{invalid suffix 'bf166' on floating constant}}
|
@@ -28,3 +33,39 @@ __bf16 t = 1BF16; // expected-error{{invalid digit 'B' in decimal constant}}
|
28 | 33 | __bf16 u = 1.bf16F16; // expected-error{{invalid suffix 'bf16F16' on floating constant}}
|
29 | 34 | __bf16 v = 1.BF16f16; // expected-error{{invalid suffix 'BF16f16' on floating constant}}
|
30 | 35 | __bf16 w = 1.F16bf16; // expected-error{{invalid suffix 'F16bf16' on floating constant}}
|
| 36 | + |
| 37 | +#endif |
| 38 | + |
| 39 | +#ifndef SUPPORTED |
| 40 | + |
| 41 | +__bf16 a = 1.b; // expected-error{{__bf16 is not supported on this target}} |
| 42 | +__bf16 b = 1.bf; // expected-error{{__bf16 is not supported on this target}} |
| 43 | +__bf16 c = 1.bf166; // expected-error{{__bf16 is not supported on this target}} |
| 44 | +__bf16 d = 1.bf1; // expected-error{{__bf16 is not supported on this target}} |
| 45 | + |
| 46 | +__bf16 e = 1.B; // expected-error{{__bf16 is not supported on this target}} |
| 47 | +__bf16 f = 1.BF; // expected-error{{__bf16 is not supported on this target}} |
| 48 | +__bf16 g = 1.BF166; // expected-error{{__bf16 is not supported on this target}} |
| 49 | +__bf16 h = 1.BF1; // expected-error{{__bf16 is not supported on this target}} |
| 50 | + |
| 51 | +__bf16 i = 1.bf16; // expect-success |
| 52 | +__bf16 j = 1.BF16; // expect-success |
| 53 | + |
| 54 | +__bf16 k = 1B; // expected-error{{invalid digit 'B' in decimal constant}} |
| 55 | +__bf16 l = 1BF; // expected-error{{invalid digit 'B' in decimal constant}} |
| 56 | +__bf16 m = 1BF166; // expected-error{{invalid digit 'B' in decimal constant}} |
| 57 | +__bf16 n = 1BF1; // expected-error{{invalid digit 'B' in decimal constant}} |
| 58 | + |
| 59 | +__bf16 o = 1b; // expected-error{{invalid digit 'b' in decimal constant}} |
| 60 | +__bf16 p = 1bf; // expected-error{{invalid digit 'b' in decimal constant}} |
| 61 | +__bf16 q = 1bf166; // expected-error{{invalid digit 'b' in decimal constant}} |
| 62 | +__bf16 r = 1bf1; // expected-error{{invalid digit 'b' in decimal constant}} |
| 63 | + |
| 64 | +__bf16 s = 1bf16; // expected-error{{invalid digit 'b' in decimal constant}} |
| 65 | +__bf16 t = 1BF16; // expected-error{{invalid digit 'B' in decimal constant}} |
| 66 | + |
| 67 | +__bf16 u = 1.bf16F16; // expected-error{{invalid suffix 'bf16F16' on floating constant}} |
| 68 | +__bf16 v = 1.BF16f16; // expected-error{{invalid suffix 'BF16f16' on floating constant}} |
| 69 | +__bf16 w = 1.F16bf16; // expected-error{{invalid suffix 'F16bf16' on floating constant}} |
| 70 | + |
| 71 | +#endif |
0 commit comments