Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.target / i386 / asm-4.c
blobc1324388dae290cd23afc6ffb25fd839ac821d46
1 /* Test if functions marked __attribute__((used)), but with address never
2 taken in C code, don't use alternate calling convention for local
3 functions on IA-32. */
4 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
5 /* { dg-options "-O2" } */
7 extern void abort (void);
9 static int foo (int, int, int, int) __asm ("foo");
10 static __attribute__((noinline, used)) int
11 foo (int i, int j, int k, int l)
13 return i + j + k + l;
16 void
17 bar (void)
19 if (foo (1, 2, 3, 4) != 10)
20 abort ();
23 int (*fn) (int, int, int, int);
25 void
26 baz (void)
28 __asm ("movl $foo, %k0" : "=r" (fn));
29 if (fn (2, 3, 4, 5) != 14)
30 abort ();
33 int
34 main (void)
36 bar ();
37 baz ();
38 return 0;