2013-10-21 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / attr-externally-visible-1.c
blobe1db6923a4843456bd2aca489e0790dacb570e41
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fwhole-program" } */
3 /* { dg-final { scan-assembler "foo1" } } */
4 /* { dg-final { scan-assembler "foo2" } } */
5 /* { dg-final { scan-assembler "foo3" } } */
6 /* { dg-final { scan-assembler "foo4" } } */
7 /* { dg-final { scan-assembler "foo5" } } */
8 /* { dg-final { scan-assembler-not "foo6" } } */
9 /* { dg-final { scan-assembler "bar1" } } */
10 /* { dg-final { scan-assembler "bar2" } } */
11 /* { dg-final { scan-assembler "bar3" } } */
12 /* { dg-final { scan-assembler "bar4" } } */
13 /* { dg-final { scan-assembler "bar5" } } */
14 /* { dg-final { scan-assembler-not "bar6" } } */
16 extern void foo1 (void) __attribute__((externally_visible));
17 void foo1 (void) { }
19 extern void foo2 (void) __attribute__((externally_visible));
20 __attribute__((externally_visible)) void foo2 (void) { }
22 extern void foo3 (void);
23 __attribute__((externally_visible)) void foo3 (void) { }
25 __attribute__((externally_visible)) void foo4 (void) { }
27 void foo5 (void) { }
28 extern void foo5 (void) __attribute__((externally_visible));
30 void foo6 (void) { }
32 extern char *bar1 __attribute__((externally_visible));
33 char *bar1;
35 extern char *bar2 __attribute__((externally_visible));
36 char *bar2 __attribute__((externally_visible));
38 extern char *bar3;
39 char *bar3 __attribute__((externally_visible));
41 char *bar4 __attribute__((externally_visible));
43 char *bar5;
44 extern char *bar5 __attribute__((externally_visible));
46 char *bar6;
48 int main (void) { }