1 ;; Test that the global merge pass does not pool globals that are
2 ;; in llvm.used or in llvm.compiler.used.
4 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc-ibm-aix-xcoff \
5 ; RUN: -data-sections=false < %s | \
8 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc64-ibm-aix-xcoff \
9 ; RUN: -data-sections=false < %s | \
12 @keep_this = internal constant [5 x i8] c"keep1", align 1
13 @keep_this2 = internal constant [5 x i8] c"keep2", align 1
14 @.str.1 = private unnamed_addr constant [12 x i8] c"str1_STRING\00", align 1
15 @.str.2 = private unnamed_addr constant [12 x i8] c"str2_STRING\00", align 1
16 @.str.3 = private unnamed_addr constant [12 x i8] c"str3_STRING\00", align 1
17 @llvm.used = appending global [1 x ptr] [ptr @keep_this], section "llvm.metadata"
18 @llvm.compiler.used = appending global [1 x ptr] [ptr @keep_this2], section "llvm.metadata"
20 declare signext i32 @callee(ptr noundef)
22 define dso_local signext i32 @keep1() {
24 %call = tail call signext i32 @callee(ptr noundef nonnull @keep_this)
28 define dso_local signext i32 @keep2() {
30 %call = tail call signext i32 @callee(ptr noundef nonnull @keep_this2)
34 define dso_local signext i32 @str1() {
36 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.1)
40 define dso_local signext i32 @str2() {
42 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.2)
46 define dso_local signext i32 @str3() {
48 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.3)
52 ; CHECK: .lglobl keep_this
54 ; CHECK: .lglobl keep_this2
56 ; CHECK: L.._MergedGlobals:
57 ; CHECK: .string "str1_STRING"
58 ; CHECK: .string "str2_STRING"
59 ; CHECK: .string "str3_STRING"