libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / heap-trampoline-1.c
blob1aebe00d73194a28a76c22144e8ccd37c7793ed1
1 /* { dg-do run { target heap_trampoline } } */
2 /* { dg-options "-ftrampoline-impl=heap" } */
4 __attribute__((noipa)) int
5 bar (int (*fn) (int))
7 return fn (42) + 1;
10 int
11 main ()
13 int a = 0;
14 int foo (int x) { if (x != 42) __builtin_abort (); return ++a; }
15 if (bar (foo) != 2 || a != 1)
16 __builtin_abort ();
17 if (bar (foo) != 3 || a != 2)
18 __builtin_abort ();
19 a = 42;
20 if (bar (foo) != 44 || a != 43)
21 __builtin_abort ();
22 return 0;