Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.dg / special / gcsec-1.c
blob68d4066fa39976b67711753762815b833efeafac
1 /* AIX gld supports garbage collection. But AIX gcc does not support
2 -ffunction-sections or -fdata-sections. */
3 /* { dg-do run { xfail rs6000-*-aix* powerpc*-*-aix* } } */
4 /* { dg-require-gc-sections "" } */
6 /* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" } */
7 /* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections -static" { target native } } */
8 /* { dg-options "-ffunction-sections -fdata-sections -Wl,--gc-sections" { target *-*-netware* } } */
10 #include <stdlib.h>
12 static int unusedint=5;
14 static int usedint=1;
16 int unused(void) {
17 return 1;
20 int foo(void) {
21 return usedint;
24 int main(void) {
26 if (foo())
27 exit(0);
28 else
29 abort();