60 lines · plain
1;; Test that the global merge pass does not pool globals that are2;; 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 %s7 8; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple powerpc64-ibm-aix-xcoff \9; RUN: -data-sections=false < %s | \10; RUN: FileCheck %s11 12@keep_this = internal constant [5 x i8] c"keep1", align 113@keep_this2 = internal constant [5 x i8] c"keep2", align 114@.str.1 = private unnamed_addr constant [12 x i8] c"str1_STRING\00", align 115@.str.2 = private unnamed_addr constant [12 x i8] c"str2_STRING\00", align 116@.str.3 = private unnamed_addr constant [12 x i8] c"str3_STRING\00", align 117@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 20declare signext i32 @callee(ptr noundef)21 22define dso_local signext i32 @keep1() {23entry:24 %call = tail call signext i32 @callee(ptr noundef nonnull @keep_this)25 ret i32 %call26}27 28define dso_local signext i32 @keep2() {29entry:30 %call = tail call signext i32 @callee(ptr noundef nonnull @keep_this2)31 ret i32 %call32}33 34define dso_local signext i32 @str1() {35entry:36 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.1)37 ret i32 %call38}39 40define dso_local signext i32 @str2() {41entry:42 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.2)43 ret i32 %call44}45 46define dso_local signext i32 @str3() {47entry:48 %call = tail call signext i32 @callee(ptr noundef nonnull @.str.3)49 ret i32 %call50}51 52; CHECK: .lglobl keep_this53; CHECK: keep_this:54; CHECK: .lglobl keep_this255; CHECK: keep_this2:56; CHECK: L.._MergedGlobals:57; CHECK: .string "str1_STRING"58; CHECK: .string "str2_STRING"59; CHECK: .string "str3_STRING"60