OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [weak/] [typeof-2.c] - Blame information for rev 645

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test typeof with __asm redirection. */
2
/* { dg-do compile } */
3
/* { dg-require-weak "" } */
4
/* { dg-require-alias "" } */
5
/* { dg-options "-O2" } */
6
 
7
extern int foo1 (int x) __asm ("baz1");
8
int bar1 (int x) { return x; }
9
extern __typeof (bar1) foo1 __attribute ((weak, alias ("bar1")));
10
 
11
extern int foo2 (int x) __attribute__ ((const));
12
extern __typeof (foo2) foo2 __asm ("baz2");
13
int bar2 (int x)
14
{
15
  return foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x) + foo2 (x);
16
}
17
 
18
extern int foo3 (int x);
19
extern __typeof (foo3) foo3 __asm ("baz3");
20
int bar3 (int x)
21
{
22
  return foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x) + foo3 (x);
23
}
24
 
25
// { dg-final { scan-assembler-not "foo1" } }
26
// { dg-final { scan-assembler "baz1" } }
27
// { dg-final { scan-assembler-not "foo2" } }
28
// { dg-final { scan-assembler "baz2" } }
29
// { dg-final { scan-assembler-not "baz2.*baz2.*baz2.*baz2.*baz2.*baz2" } }
30
// { dg-final { scan-assembler-not "foo3" } }
31
// SH targets put the funtion address into a constant pool and / or register,
32
// so it does not appear repeated (as much as expected) in the assembler.
33
// { dg-final { global target_triplet } }
34
// { dg-final { if [string match sh-*-* $target_triplet ] {return} } }
35
// { dg-final { if [string match {sh[elb1-9]*-*-*} $target_triplet ] {return} } }
36
// Likewise for S/390 targets
37
// { dg-final { if [string match s390*-*-* $target_triplet ] {return} } }
38
// Likewise for CRIS targets.
39
// { dg-final { if [string match cris-*-* $target_triplet ] {return} } }
40
// Likewise for m68k targets.
41
// { dg-final { if [string match m68k-*-* $target_triplet ] {return} } }
42
// { dg-final { scan-assembler "baz3.*baz3.*baz3.*baz3.*baz3.*baz3" } }

powered by: WebSVN 2.1.0

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