Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / c-c++-common / attr-opt-1.c
blobfc9b4a691b529f74b589f20f3cf138d15a49de86
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" } */
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" } */
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" } */
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);