46 lines · plain
1;; Tests for invalid path cloning with -basic-block-sections involving indirect branches.2 3declare void @effect(i32 zeroext)4 5;; Test failed application of path cloning for paths with indirect branches.6; RUN: echo 'v1' > %t17; RUN: echo 'f bar' >> %t18; RUN: echo 'p 0 1 2' >> %t19; RUN: echo 'c 0 1.1 2.1 1' >> %t110; RUN: llc < %s -mtriple=x86_64-pc-linux -O0 -function-sections -basic-block-sections=%t1 2> %t1.err | FileCheck %s11; RUN: FileCheck %s --check-prefix=WARN < %t1.err12; RUN: echo 'v1' > %t213; RUN: echo 'f bar' >> %t214; RUN: echo 'p 1 2' >> %t215; RUN: echo 'c 0 1 2.1' >> %t216; RUN: llc < %s -mtriple=x86_64-pc-linux -O0 -function-sections -basic-block-sections=%t2 2> %t2.err | FileCheck %s17; RUN: FileCheck %s --check-prefix=WARN < %t2.err18 19 20define void @bar(i1 %a, i1 %b) {21b0:22 call void @effect(i32 0)23 br i1 %a, label %b1, label %b224b1: ; preds = %b025 call void @effect(i32 1)26 %0 = select i1 %b, ; <ptr> [#uses=1]27 ptr blockaddress(@bar, %b2),28 ptr blockaddress(@bar, %b3)29 indirectbr ptr %0, [label %b2, label %b3]30b2: ; preds = %b0, %b131 call void @effect(i32 2)32 ret void33b3:34 call void @effect(i32 3) ; preds = %b135 ret void36}37 38; CHECK: .section .text.bar,"ax",@progbits39; CHECK: bar:40; CHECK: # %bb.0: # %b041; CHECK: # %bb.1: # %b142; CHECK: .section .text.split.bar,"ax",@progbits43; CHECK: bar.cold: # %b2 44 45; WARN: warning: block #1 has indirect branch and appears as the non-tail block of a path in function bar46