1 ;; This test verifies that -gc-empty-basic-blocks removes regular empty blocks
2 ;; but does not remove empty blocks which have their address taken.
3 ; RUN: llc < %s -mtriple=x86_64 -O0 -gc-empty-basic-blocks | FileCheck %s
5 ;; This function has a regular empty block.
6 define void @foo(i1 zeroext %0) nounwind {
7 br i1 %0, label %2, label %empty_block
12 ; CHECK-NEXT: jmp .LBB0_3
18 ; CHECK-LABEL: .LBB0_1:
21 empty_block: ; preds = %1
24 ; CHECK-NOT: %empty_block
27 4: ; preds = %2, %empty_block
30 ; CHECK-LABEL: .LBB0_3:
35 ;; This function has an empty block which has its address taken. Check that it
36 ;; is not removed by -gc-empty-basic-blocks.
37 define void @bar(i1 zeroext %0) nounwind {
39 %1 = select i1 %0, ptr blockaddress(@bar, %empty_block), ptr blockaddress(@bar, %bb2) ; <ptr> [#uses=1]
40 indirectbr ptr %1, [label %empty_block, label %bb2]
44 empty_block: ; preds = %entry
47 ; CHECK-LABEL: .LBB1_1: # %empty_block