| 1 |
;; Test that the global merge pass does not pool globals that are |
| 2 |
;; in llvm.used or in llvm.compiler.used. |
| 3 |
|
| 4 |
; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc-ibm-aix-xcoff \ |
| 5 |
; RUN: -data-sections=false < %s | \ |
| 6 |
; RUN: FileCheck %s |
| 7 |
|
| 8 |
; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc64-ibm-aix-xcoff \ |
| 9 |
; RUN: -data-sections=false < %s | \ |
| 10 |
; RUN: FileCheck %s |
| 11 |
|
| 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" |
| 19 |
|
| 20 |
declare signext i32 @callee(ptr noundef) |
| 21 |
|
| 22 |
define dso_local signext i32 @keep1() { |
| 23 |
entry: |
| 24 |
%call = tail call signext i32 @callee(ptr noundef nonnull @keep_this) |
| 25 |
ret i32 %call |
| 26 |
} |
| 27 |
|
| 28 |
define dso_local signext i32 @keep2() { |
| 29 |
entry: |
| 30 |
%call = tail call signext i32 @callee(ptr noundef nonnull @keep_this2) |
| 31 |
ret i32 %call |
| 32 |
} |
| 33 |
|
| 34 |
define dso_local signext i32 @str1() { |
| 35 |
entry: |
| 36 |
%call = tail call signext i32 @callee(ptr noundef nonnull @.str.1) |
| 37 |
ret i32 %call |
| 38 |
} |
| 39 |
|
| 40 |
define dso_local signext i32 @str2() { |
| 41 |
entry: |
| 42 |
%call = tail call signext i32 @callee(ptr noundef nonnull @.str.2) |
| 43 |
ret i32 %call |
| 44 |
} |
| 45 |
|
| 46 |
define dso_local signext i32 @str3() { |
| 47 |
entry: |
| 48 |
%call = tail call signext i32 @callee(ptr noundef nonnull @.str.3) |
| 49 |
ret i32 %call |
| 50 |
} |
| 51 |
|
| 52 |
; CHECK: .lglobl keep_this |
| 53 |
; CHECK: keep_this: |
| 54 |
; CHECK: .lglobl keep_this2 |
| 55 |
; CHECK: keep_this2: |
| 56 |
; CHECK: L.._MergedGlobals: |
| 57 |
; CHECK: .string "str1_STRING" |
| 58 |
; CHECK: .string "str2_STRING" |
| 59 |
; CHECK: .string "str3_STRING" |