brintos

brintos / llvm-project-archived public Read only

0
0
Text · 721 B · 11a2d10 Raw
28 lines · plain
1; RUN: opt < %s -passes=globalopt -S | FileCheck %s2 3; CHECK-NOT: test4 5declare void @aa()6declare void @bb()7 8; Test that we can erase a function which has a blockaddress referring to it9@test.x = internal unnamed_addr constant [3 x ptr] [ptr blockaddress(@test, %a), ptr blockaddress(@test, %b), ptr blockaddress(@test, %c)], align 1610define internal void @test(i32 %n) nounwind noinline {11entry:12  %idxprom = sext i32 %n to i6413  %arrayidx = getelementptr inbounds [3 x ptr], ptr @test.x, i64 0, i64 %idxprom14  %0 = load ptr, ptr %arrayidx, align 815  indirectbr ptr %0, [label %a, label %b, label %c]16 17a:18  tail call void @aa() nounwind19  br label %b20 21b:22  tail call void @bb() nounwind23  br label %c24 25c:26  ret void27}28