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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [weak/] [weak-3.c] - Blame information for rev 856

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-alias "" } */
3
/* { dg-require-weak "" } */
4
/* { dg-options "-fno-common -Waddress" } */
5
 
6
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */
7
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */
8
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1c" } } */
9
/* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?ffoo1d" } } */
10
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1e" } } */
11
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1f" } } */
12
/* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1g" } } */
13
 
14
/* test function addresses with __attribute__((weak)) */
15
 
16
extern void * ffoo1a (void) __attribute__((weak));
17
extern void * ffoo1a (void);
18
void * foo1a (void)
19
{
20
  return (void *)ffoo1a;
21
}
22
 
23
 
24
extern void * ffoo1b (void);
25
extern void * ffoo1b (void) __attribute__((weak));
26
void * foo1b (void)
27
{
28
  return (void *)ffoo1b;
29
}
30
 
31
 
32
extern void * ffoo1c (void);
33
void * foo1c (void)
34
{
35
  return (void *)ffoo1c;
36
}
37
extern void * ffoo1c (void) __attribute__((weak)); /* { dg-warning "weak declaration" "weak declaration" } */
38
 
39
 
40
int ffoo1d (void);
41
int ffoo1d (void) __attribute__((weak));
42
 
43
 
44
extern void * ffoo1e (void);
45
extern void * ffoo1e (void)  __attribute__((weak));
46
void * foo1e (void)
47
{
48
  if (ffoo1e)
49
    ffoo1e ();
50
  return 0;
51
}
52
 
53
 
54
extern void * ffoo1f (void);
55
void * foo1f (void)
56
{
57
  if (ffoo1f) /* { dg-warning "" } */
58
    ffoo1f ();
59
  return 0;
60
}
61
void * ffoox1f (void) { return (void *)0; }
62
extern void * ffoo1f (void)  __attribute__((weak, alias ("ffoox1f"))); /* { dg-warning "weak declaration" "weak declaration" } */
63
 
64
 
65
extern void * ffoo1g (void);
66
void * ffoox1g (void) { return (void *)0; }
67
extern void * ffoo1g (void)  __attribute__((weak, alias ("ffoox1g")));
68
void * foo1g (void)
69
{
70
  if (ffoo1g)
71
    ffoo1g ();
72
  return 0;
73
}

powered by: WebSVN 2.1.0

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