1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 target triple = "hexagon"
4 %type.0 = type { i32, ptr, i32, i32, i32 }
6 ; Check that CFI is before the packet with call+allocframe.
10 ; CHECK-NEXT: allocframe
18 define ptr @danny(ptr %p0, i32 %p1) #0 {
20 %t0 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 4
21 %t1 = load i32, ptr %t0, align 4
22 %th = icmp ugt i32 %t1, %p1
23 br i1 %th, label %if.end, label %if.then
25 if.then: ; preds = %entry
26 tail call void @throw(ptr nonnull %p0)
29 if.end: ; preds = %entry
30 %t6 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 3
31 %t2 = load i32, ptr %t6, align 4
32 %t9 = add i32 %t2, %p1
35 %t7 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 2
36 %t3 = load i32, ptr %t7, align 4
37 %tc = icmp ult i32 %ta, %t3
38 %td = select i1 %tc, i32 0, i32 %t3
39 %te = sub i32 %ta, %td
40 %t8 = getelementptr inbounds %type.0, ptr %p0, i32 0, i32 1
41 %t4 = load ptr, ptr %t8, align 4
42 %tf = getelementptr inbounds ptr, ptr %t4, i32 %te
43 %t5 = load ptr, ptr %tf, align 4
44 %tg = getelementptr inbounds i8, ptr %t5, i32 %tb
48 ; Check that CFI is after allocframe.
53 define void @sammy(ptr %p0, i32 %p1) #0 {
55 %t0 = icmp sgt i32 %p1, 0
56 br i1 %t0, label %if.then, label %if.else
58 call void @throw(ptr nonnull %p0)
61 call void @nothrow() #2
67 declare void @throw(ptr) #1
68 declare void @nothrow() #2
70 attributes #0 = { "target-cpu"="hexagonv55" }
71 attributes #1 = { noreturn "target-cpu"="hexagonv55" }
72 attributes #2 = { nounwind "target-cpu"="hexagonv55" }