1 /* Test if functions marked __attribute__((used)), but with address never
2 taken in C code, don't use alternate calling convention for local
5 /* The asm in this test uses an absolute address. */
6 /* { dg-require-effective-target nonpic } */
7 /* { dg-options "-O2" } */
9 extern void abort (void);
11 static int foo (int, int, int, int) __asm ("foo");
12 static __attribute__((noinline
, used
)) int
13 foo (int i
, int j
, int k
, int l
)
21 if (foo (1, 2, 3, 4) != 10)
25 int (*fn
) (int, int, int, int);
30 /* Darwin loads 64-bit regions above the 4GB boundary so
31 we need to use this instead. */
32 #if defined (__LP64__) && defined (__MACH__)
33 __asm ("leaq foo(%%rip), %0" : "=r" (fn
));
35 __asm ("movl $foo, %k0" : "=r" (fn
));
37 if (fn (2, 3, 4, 5) != 14)