blob: 080ef6639c9ee66ba5e3f757438230fb27cb2781 [file] [log] [blame]
Krzysztof Parzyszek046090d2018-03-12 14:01:28 +00001; RUN: llc -march=hexagon -O2 < %s | FileCheck %s
2
3; The purpose of this test is to make sure that the packetizer is ignoring
4; CFI instructions while forming packet for allocframe. Refer to 7d7d99622
5; which replaced PROLOG_LABEL with CFI_INSTRUCTION.
6
7@g0 = external constant i8*
8
9; We used to emit:
10; {
11; allocframe(#0)
12; }
13; {
14; r0 = #4
15; But we can put more instructions in the first packet.
16
17; CHECK: {
18; CHECK-NEXT: call f1
19; CHECK-NEXT: r0 = #4
20; CHECK-NEXT: allocframe(#0)
21; CHECK-NEXT: }
22
23define i32 @f0() personality i8* bitcast (i32 (...)* @f3 to i8*) {
24b0:
25 %v0 = tail call i8* @f1(i32 4) #1
26 %v1 = bitcast i8* %v0 to i32*
27 store i32 20, i32* %v1, align 4, !tbaa !0
28 invoke void @f2(i8* %v0, i8* bitcast (i8** @g0 to i8*), i8* null) #2
29 to label %b4 unwind label %b1
30
31b1: ; preds = %b0
32 %v2 = landingpad { i8*, i32 }
33 catch i8* bitcast (i8** @g0 to i8*)
34 %v3 = extractvalue { i8*, i32 } %v2, 1
35 %v4 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @g0 to i8*)) #1
36 %v5 = icmp eq i32 %v3, %v4
37 br i1 %v5, label %b2, label %b3
38
39b2: ; preds = %b1
40 %v6 = extractvalue { i8*, i32 } %v2, 0
41 %v7 = tail call i8* @f4(i8* %v6) #1
42 tail call void @f5() #1
43 ret i32 1
44
45b3: ; preds = %b1
46 resume { i8*, i32 } %v2
47
48b4: ; preds = %b0
49 unreachable
50}
51
52declare i8* @f1(i32)
53
54declare void @f2(i8*, i8*, i8*)
55
56declare i32 @f3(...)
57
58; Function Attrs: nounwind readnone
59declare i32 @llvm.eh.typeid.for(i8*) #0
60
61declare i8* @f4(i8*)
62
63declare void @f5()
64
65attributes #0 = { nounwind readnone }
66attributes #1 = { nounwind }
67attributes #2 = { noreturn }
68
69!0 = !{!1, !1, i64 0}
70!1 = !{!"int", !2}
71!2 = !{!"omnipotent char", !3}
72!3 = !{!"Simple C/C++ TBAA"}