Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / gcc.target / arm / fp16-compile-exprtype.c
blob1d8953b489a28dc879f7ae04e496c850a1f21efc
1 /* Test that expressions involving __fp16 values have the right types. */
2 /* { dg-do compile } */
3 /* { dg-options "-mfp16-format=ieee" } */
5 /* This produces a diagnostic if EXPR doesn't have type TYPE. */
6 #define CHECK(expr,type) \
7 do { \
8 type v; \
9 __typeof (expr) *p = &v; \
10 } while (0);
12 volatile __fp16 f1;
13 volatile __fp16 f2;
15 int
16 main (void)
18 CHECK (f1, __fp16);
19 CHECK (+f1, float);
20 CHECK (-f1, float);
21 CHECK (f1+f2, float);
22 CHECK ((__fp16)(f1+f2), __fp16);
23 CHECK ((__fp16)99.99, __fp16);
24 CHECK ((f1+f2, f1), __fp16);