1 /* { dg-do compile } */ 2 3 int __attribute__ ((common)) common; 4 static int local; 5 extern int external_decl; 6 int external_defn; 7 foo()8int foo () 9 { 10 return common + local + external_decl + external_defn; 11 } 12 bar(int i)13void bar (int i) 14 { 15 common = local = external_decl = external_defn = i; 16 } 17 18 /* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.weak .global\[^,\n\r\]*common" } } */ 19 /* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.global\[^,\n\r\]*local" } } */ 20 /* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.extern .global\[^,\n\r\]*external_decl" } } */ 21 /* { dg-final { scan-assembler "\[\n\r\]\[\t \]*.visible .global\[^,\n\r\]*external_defn" } } */ 22