Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/call-trap-1.c

raw
1 /* Undefined behavior from a call to a function cast to a different
2 type does not appear until after the function designator and
3 arguments have been evaluated. PR 38483. */
4 /* Origin: Joseph Myers <[email protected]> */
5 /* { dg-require-effective-target untyped_assembly } */
6
7 extern void exit (int);
8 extern void abort (void);
9
10 int
11 foo (void)
12 {
13 exit (0);
14 return 0;
15 }
16
17 void
18 bar (void)
19 {
20 }
21
22 int
23 main (void)
24 {
25 ((long (*)(int))bar) (foo ());
26 abort ();
27 }