1 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
4 // CHECK-NOT: @a = global
7 // CHECK-NOT: @_ZN3foo1bE = global
10 // CHECK: @_ZN3foo1cE = {{(dso_local )?}}global
13 // CHECK-NOT: @_ZN3foo1dE
16 // CHECK-NOT: should_not_appear
17 extern "C++" int should_not_appear
;
19 // CHECK: @_ZN3foo10extern_cxxE = {{(dso_local )?}}global
20 extern "C++" int extern_cxx
= 0;
24 // CHECK-NOT: @global_a = {{(dso_local )?}}global
25 extern "C" int global_a
;
27 // CHECK: @global_b = {{(dso_local )?}}global
28 extern "C" int global_b
= 0;
30 // CHECK-NOT: should_not_appear
31 extern "C++" int should_not_appear
;
33 // CHECK: @extern_cxx = {{(dso_local )?}}global
34 extern "C++" int extern_cxx
= 0;
41 // CHECK: @test1_b = {{(dso_local )?}}global
45 // CHECK: @_ZN5test13useE = {{(dso_local )?}}global
53 // CHECK: @test2_b = {{(dso_local )?}}global
59 static int unused_var
;
60 static int unused_fn() { return 0; }
62 __attribute__((used
)) static int internal_var
;
63 __attribute__((used
)) static int internal_fn() { return 0; }
65 __attribute__((used
)) static int duplicate_internal_var
;
66 __attribute__((used
)) static int duplicate_internal_fn() { return 0; }
69 __attribute__((used
)) static int duplicate_internal_var
;
70 __attribute__((used
)) static int duplicate_internal_fn() { return 0; }
73 // CHECK: @llvm.compiler.used = appending global {{.*}} @internal_var, {{.*}} @internal_fn
76 // CHECK-NOT: @duplicate_internal
77 // CHECK: @internal_var = internal alias i32, ptr @_ZL12internal_var
79 // CHECK-NOT: @duplicate_internal
80 // CHECK: @internal_fn = internal alias i32 (), ptr @_ZL11internal_fnv
82 // CHECK-NOT: @duplicate_internal
86 struct A
{ void f(); };
87 extern "C" void A::f() { void g(); g(); }
88 // CHECK-LABEL: @_ZN7PR194111A1fEv(
89 // CHECK: call {{.*}}void @g()