1 /* { dg-options "-O2" } */ 2 3 __attribute__((noreturn)) void (*fn) (void); 4 5 volatile int v; 6 7 __attribute__((noreturn)) void fn0(void)8fn0 (void) 9 { 10 __builtin_exit (0); 11 } 12 13 __attribute__((noreturn)) void fn1(void)14fn1 (void) 15 { 16 __builtin_exit (1); 17 } 18 19 __attribute__((noinline, noclone)) void setfn(void (* x)(void))20setfn (__attribute__((noreturn)) void (*x) (void)) 21 { 22 fn = x; 23 } 24 25 int main()26main () 27 { 28 int i; 29 if (v < 1) 30 setfn (fn0); 31 else 32 setfn (fn1); 33 fn (); 34 } 35