]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/tree-ssa/attr-alias.c
* gcc.dg/tree-ssa/attr-alias.c: Skip if no weak support.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / attr-alias.c
CommitLineData
aaae719d
JH
1/* { dg-do compile } */
2/* { dg-require-alias "" } */
47abbc31 3/* { dg-require-weak "" } */
830976a1 4/* { dg-options "-O2 -fdump-tree-optimized -std=gnu89" } */
aaae719d
JH
5void abort (void);
6__attribute__ ((weak))
7int test()
8{
9 return 0;
10}
11static int test2() __attribute__ ((alias("test")));
8a41354f 12static int test1() __attribute__ ((weakref)) __attribute__ ((alias("test2")));
aaae719d
JH
13static int test4() __attribute__ ((weakref)) __attribute__ ((alias("test")));
14main()
15{
16 test();
17 test2();
18 test3();
19 test4();
20}
21
22/* calls to test1 and test2 can be inlined and optmized away. Calls
23 to test and test4 are overwritable. */
24
cf28fab6
JH
25/* { dg-final { scan-tree-dump-times " test " 1 "optimized" } } */
26/* { dg-final { scan-tree-dump-times " test4 " 1 "optimized" } } */
27/* { dg-final { scan-tree-dump-not " test1 " "optimized" } } */
28/* { dg-final { scan-tree-dump-not " test2 " "optimized" } } */