]>
Commit | Line | Data |
---|---|---|
aaae719d JH |
1 | /* { dg-do compile } */ |
2 | /* { dg-require-alias "" } */ | |
830976a1 | 3 | /* { dg-options "-O2 -fdump-tree-optimized -std=gnu89" } */ |
aaae719d JH |
4 | void abort (void); |
5 | __attribute__ ((weak)) | |
6 | int test() | |
7 | { | |
8 | return 0; | |
9 | } | |
10 | static int test2() __attribute__ ((alias("test"))); | |
8a41354f | 11 | static int test1() __attribute__ ((weakref)) __attribute__ ((alias("test2"))); |
aaae719d JH |
12 | static int test4() __attribute__ ((weakref)) __attribute__ ((alias("test"))); |
13 | main() | |
14 | { | |
15 | test(); | |
16 | test2(); | |
17 | test3(); | |
18 | test4(); | |
19 | } | |
20 | ||
21 | /* calls to test1 and test2 can be inlined and optmized away. Calls | |
22 | to test and test4 are overwritable. */ | |
23 | ||
cf28fab6 JH |
24 | /* { dg-final { scan-tree-dump-times " test " 1 "optimized" } } */ |
25 | /* { dg-final { scan-tree-dump-times " test4 " 1 "optimized" } } */ | |
26 | /* { dg-final { scan-tree-dump-not " test1 " "optimized" } } */ | |
27 | /* { dg-final { scan-tree-dump-not " test2 " "optimized" } } */ |