1 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s 2 namespace foo { 3 4 // CHECK-NOT: @a = global i32 5 extern "C" int a; 6 7 // CHECK-NOT: @_ZN3foo1bE = global i32 8 extern int b; 9 10 // CHECK: @_ZN3foo1cE = global i32 11 int c = 5; 12 13 // CHECK-NOT: @_ZN3foo1dE 14 extern "C" struct d; 15 16 } 17 18 namespace test1 { 19 namespace { 20 struct X {}; 21 } 22 extern "C" { 23 // CHECK: @test1_b = global 24 X test1_b = X(); 25 } 26 void *use = &test1_b; 27 // CHECK: @_ZN5test13useE = global 28 } 29 30 namespace test2 { 31 namespace { 32 struct X {}; 33 } 34 35 // CHECK: @test2_b = global 36 extern "C" X test2_b; 37 X test2_b; 38 } 39