summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/20020218-1.c
blob: 2887328d5fb743ffd2779bc68b0c18732e2cbee0 (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
27
28
29
30
31
32
33
34
/* Verify that X86-64 only SSE registers aren't restored on IA-32.  */
/* { dg-do compile { target i?86-*-* } } */
/* { dg-options "-O2 -msse" } */
/* { dg-final { scan-assembler-not "xmm8" } } */

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

void *bar (void *p, void *q)
{
  if (p != (void *) 26 || q != (void *) 35)
    abort ();
  return (void *) 76;
}

void *foo (void **args)
{
  void *argcookie = &args[1];

  __builtin_return (__builtin_apply (args[0], &argcookie,
				     2 * sizeof (void *)));
}

int main (void)
{
  void *args[3];

  args[0] = (void *) bar;
  args[1] = (void *) 26;
  args[2] = (void *) 35;
  if (foo (args) != (void *) 76)
    abort ();
  exit (0);
}
OpenPOWER on IntegriCloud