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.5.1/] [gcc/] [testsuite/] [gcc.dg/] [weak/] [typeof-2.c] - Blame information for rev 307

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

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