1 // This test checks if internal linkage symbols get unique names with
2 // -funique-internal-linkage-names option.
3 // RUN: %clang_cc1 -triple x86_64-linux-gnu -x c++ -emit-llvm -o - < %s | FileCheck %s --check-prefix=PLAIN
4 // RUN: %clang_cc1 -triple x86_64-linux-gnu -x c++ -emit-llvm -funique-internal-linkage-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
19 // Function local static variable and anonymous namespace namespace variable.
29 return getM() + fGlob
;
32 // Multiversioning symbols
33 __attribute__((target("default"))) static int mver() {
37 __attribute__((target("sse4.2"))) static int mver() {
57 // PLAIN: @_ZL4glob = internal global
58 // PLAIN: @_ZZ8retAnonMvE5fGlob = internal global
59 // PLAIN: @_ZN12_GLOBAL__N_16anon_mE = internal global
60 // PLAIN: define internal noundef i32 @_ZL3foov()
61 // PLAIN: define internal noundef i32 @_ZN12_GLOBAL__N_14getMEv
62 // PLAIN: define internal ptr @_ZL4mverv.resolver()
63 // PLAIN: define internal void @_ZN12_GLOBAL__N_11AC1Ev
64 // PLAIN: define internal void @_ZN12_GLOBAL__N_11AD1Ev
65 // PLAIN: define internal noundef i32 @_ZL4mverv()
66 // PLAIN: define internal noundef i32 @_ZL4mverv.sse4.2()
67 // PLAIN-NOT: "sample-profile-suffix-elision-policy"
68 // UNIQUE: @_ZL4glob = internal global
69 // UNIQUE: @_ZZ8retAnonMvE5fGlob = internal global
70 // UNIQUE: @_ZN12_GLOBAL__N_16anon_mE = internal global
71 // UNIQUE: define internal noundef i32 @_ZL3foov.[[MODHASH:__uniq.[0-9]+]]() #[[#ATTR:]] {
72 // UNIQUE: define internal noundef i32 @_ZN12_GLOBAL__N_14getMEv.[[MODHASH]]
73 // UNIQUE: define internal ptr @_ZL4mverv.[[MODHASH]].resolver()
74 // UNIQUE: define internal void @_ZN12_GLOBAL__N_11AC1Ev.__uniq.68358509610070717889884130747296293671
75 // UNIQUE: define internal void @_ZN12_GLOBAL__N_11AD1Ev.__uniq.68358509610070717889884130747296293671
76 // UNIQUE: define internal noundef i32 @_ZL4mverv.[[MODHASH]]()
77 // UNIQUE: define internal noundef i32 @_ZL4mverv.[[MODHASH]].sse4.2
78 // UNIQUE: attributes #[[#ATTR]] = { {{.*}}"sample-profile-suffix-elision-policy"{{.*}} }