| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-O" } |
| 3 |
// Make sure inlined non-outlined functions aren't marked weak. |
| 4 |
// We'd get a ".weak xyzzy" annotation trigged by the second declaration. |
| 5 |
|
| 6 |
// { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?xyzzy" } } |
| 7 |
|
| 8 |
// The next check isn't really part of the actual test, just to make |
| 9 |
// sure there's no outline-copy of xyzzy, because if that really |
| 10 |
// happened, it *should* be marked linkonce or perhaps weak. |
| 11 |
// { dg-final { scan-assembler-not "xyzzy" } } |
| 12 |
|
| 13 |
extern int x; |
| 14 |
extern void foo(void); |
| 15 |
extern void bar(void); |
| 16 |
|
| 17 |
extern "C" inline int xyzzy(int a) |
| 18 |
{ |
| 19 |
foo(); |
| 20 |
return a + x; |
| 21 |
} |
| 22 |
|
| 23 |
extern "C" int xyzzy(int); |
| 24 |
|
| 25 |
extern inline int plugh(int c) |
| 26 |
{ |
| 27 |
return xyzzy (c); |
| 28 |
} |
| 29 |
|
| 30 |
int y; |
| 31 |
void doit(int b) |
| 32 |
{ |
| 33 |
y = xyzzy (b) + plugh (b); |
| 34 |
} |