OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [asm-4.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* 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" } */
6
 
7
extern void abort (void);
8
 
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)
12
{
13
  return i + j + k + l;
14
}
15
 
16
void
17
bar (void)
18
{
19
  if (foo (1, 2, 3, 4) != 10)
20
    abort ();
21
}
22
 
23
int (*fn) (int, int, int, int);
24
 
25
void
26
baz (void)
27
{
28
  __asm ("movl $foo, %k0" : "=r" (fn));
29
  if (fn (2, 3, 4, 5) != 14)
30
    abort ();
31
}
32
 
33
int
34
main (void)
35
{
36
  bar ();
37
  baz ();
38
  return 0;
39
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.