PR c++/71024
[official-gcc.git] / gcc / testsuite / gcc.dg / attr-opt-1.c
blob4140fda7a2ad15e2fe5d4f9d19749b73ad12044e
1 /* PR c/70255 */
2 /* { dg-do compile } */
4 double
5 fn1 (double h, double l) /* { dg-message "previous definition" } */
7 return h + l;
9 double fn1 (double, double) __attribute__ ((optimize ("no-associative-math"))); /* { dg-warning "optimization attribute on .fn1. follows definition" } */
11 __attribute__ ((optimize ("no-associative-math"))) double
12 fn2 (double h, double l)
14 return h + l;
16 double fn2 (double, double) __attribute__ ((optimize ("no-associative-math")));
18 __attribute__ ((optimize ("no-associative-math"))) double
19 fn3 (double h, double l) /* { dg-message "previous definition" } */
21 return h + l;
23 double fn3 (double, double) __attribute__ ((optimize ("O2,no-associative-math"))); /* { dg-warning "optimization attribute on .fn3. follows definition" } */
25 __attribute__ ((optimize ("no-associative-math,O2"))) double
26 fn4 (double h, double l) /* { dg-message "previous definition" } */
28 return h + l;
30 double fn4 (double, double) __attribute__ ((optimize ("O2,no-associative-math"))); /* { dg-warning "optimization attribute on .fn4. follows definition" } */
32 __attribute__ ((optimize ("no-reciprocal-math"), optimize ("no-associative-math"))) int
33 fn5 (void)
35 return 0;
37 int __attribute__ ((optimize ("no-associative-math"), optimize ("no-reciprocal-math"))) fn5 (void);