Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / gnu2x-typeof-1.c
blobf14b54f1f7fdb2c3adac8a69aa7f15efa46a188a
1 /* Test __typeof__ propagation of noreturn function attributes with -std=gnu2x:
2 these are part of the type of a function pointer with GNU __typeof__, but
3 not with C2x typeof. */
4 /* { dg-do link } */
5 /* { dg-options "-std=gnu2x -O2" } */
7 _Noreturn void f (void);
9 __typeof__ (&f) volatile p;
10 __typeof__ (&p) volatile pp;
12 void link_failure (void);
14 void
15 g (void)
17 (*p) ();
18 link_failure ();
21 void
22 h (void)
24 (**pp) ();
25 link_failure ();
28 volatile int flag;
29 volatile int x;
31 int
32 main (void)
34 if (flag)
35 g ();
36 if (flag)
37 h ();
38 return x;