From 4b1fbdbd8e5ba1c0236a2d8e1caed095dc56fab5 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 28 Oct 2020 12:03:46 +0000 Subject: [PATCH] [llvm-reduce] Extend test to also use special globals. --- llvm/test/Reduce/remove-alias.ll | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/llvm/test/Reduce/remove-alias.ll b/llvm/test/Reduce/remove-alias.ll index 02bbf54dd19d..715b58e1a741 100644 --- a/llvm/test/Reduce/remove-alias.ll +++ b/llvm/test/Reduce/remove-alias.ll @@ -5,21 +5,43 @@ ; CHECK-INTERESTINGNESS: define void @fn3 +; CHECK-FINAL: @g1 = global +; CHECK-FINAL: @g2 = global + ; CHECK-FINAL: $a1 ; CHECK-FINAL: $a2 ; CHECK-FINAL: $a3 ; CHECK-FINAL: $a4 +; CHECK-FINAL: $a5 +; CHECK-FINAL: $a6 + +; CHECK-FINAL-NOT: @llvm.used +; CHECK-FINAL-NOT: @llvm.compiler.used ; CHECK-FINAL: define void @fn1 ; CHECK-FINAL: define void @fn2 ; CHECK-FINAL: define void @fn3 ; CHECK-FINAL: define void @fn4 +@g1 = global [ 4 x i32 ] zeroinitializer +@g2 = global [ 4 x i32 ] zeroinitializer + @"$a1" = alias void (), void ()* @fn1 @"$a2" = alias void (), void ()* @fn2 @"$a3" = alias void (), void ()* @fn3 @"$a4" = alias void (), void ()* @fn4 +@"$a5" = alias i64, bitcast (i32* getelementptr ([ 4 x i32 ], [ 4 x i32 ]* @g1, i32 0, i32 1) to i64*) +@"$a6" = alias i64, bitcast (i32* getelementptr ([ 4 x i32 ], [ 4 x i32 ]* @g2, i32 0, i32 1) to i64*) + +@llvm.used = appending global [1 x i8*] [ + i8* bitcast (i64* @"$a5" to i8*) +], section "llvm.metadata" + +@llvm.compiler.used = appending global [1 x i8*] [ + i8* bitcast (i64* @"$a6" to i8*) +], section "llvm.metadata" + define void @fn1() { ret void }