summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/call-trap-1.c
blob: aa226e745d6e13756f45c81b007314c6fa66df4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Undefined behavior from a call to a function cast to a different
   type does not appear until after the function designator and
   arguments have been evaluated.  PR 38483.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */

extern void exit (int);
extern void abort (void);

int
foo (void)
{
  exit (0);
  return 0;
}

void
bar (void)
{
}

int
main (void)
{
  ((long (*)(int))bar) (foo ());
  abort ();
}