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/] [weak-2.c] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-require-weak "" } */
3
/* { dg-options "-fno-common" } */
4
 
5
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
6
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
7
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1c" } } */
8
/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?ffoo1d" } } */
9
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1e" } } */
10
 
11
/* test function addresses with #pragma weak */
12
 
13
#pragma weak ffoo1a
14
extern void * ffoo1a (void);
15
void * foo1a (void)
16
{
17
  return (void *)ffoo1a;
18
}
19
 
20
extern void * ffoo1b (void);
21
#pragma weak ffoo1b
22
void * foo1b (void)
23
{
24
  return (void *)ffoo1b;
25
}
26
 
27
extern void * ffoo1c (void);  /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */
28
void * foo1c (void)
29
{
30
  return (void *)ffoo1c;
31
}
32
#pragma weak ffoo1c
33
 
34
 
35
int ffoo1d (void);
36
#pragma weak ffoo1d
37
 
38
 
39
extern void * ffoo1e (void);
40
#pragma weak ffoo1e
41
void * foo1e (void)
42
{
43
  if (ffoo1e)
44
    ffoo1e ();
45
  return 0;
46
}
47
 

powered by: WebSVN 2.1.0

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