1 ;; Test that the string pooling 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 -data-sections=false < %s | \
7 ; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \
10 @keep_this = internal constant [5 x i8] c"keep1", align 1
11 @keep_this2 = internal constant [5 x i8] c"keep2", align 1
12 @.str.1 = private unnamed_addr constant [12 x i8] c"str1_STRING\00", align 1
13 @.str.2 = private unnamed_addr constant [12 x i8] c"str2_STRING\00", align 1
14 @.str.3 = private unnamed_addr constant [12 x i8] c"str3_STRING\00", align 1
15 @llvm.used = appending global [1 x ptr] [ptr @keep_this], section "llvm.metadata"
16 @llvm.compiler.used = appending global [1 x ptr] [ptr @keep_this2], section "llvm.metadata"
18 declare signext i32 @callee(ptr noundef)
20 define dso_local signext i32 @keep1() {
22 %call = tail call signext i32 @callee(ptr noundef nonnull @keep_this)
26 define dso_local signext i32 @keep2() {
28 %call = tail call signext i32 @callee(ptr noundef nonnull @keep_this2)
32 define dso_local signext i32 @str1() {
34 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.1)
38 define dso_local signext i32 @str2() {
40 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.2)
44 define dso_local signext i32 @str3() {
46 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.3)
50 ; CHECK: .lglobl keep_this
52 ; CHECK: .lglobl keep_this2
54 ; CHECK: L..__ModuleStringPool:
55 ; CHECK: .string "str1_STRING"
56 ; CHECK: .string "str2_STRING"
57 ; CHECK: .string "str3_STRING"