1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; Check that all the offsets in the .cfi_offset instructions are negative.
3 ; They are all based on R30+8 which points to the pair FP/LR stored by an
4 ; allocframe. Since the stack grows towards negative addresses, anything
5 ; in the current stack frame will have a negative offset with respect to
8 ; CHECK: cfi_def_cfa r30
9 ; CHECK-NOT: .cfi_offset r{{[0-9]+}}, {{[^-]}}
11 target triple = "hexagon"
13 define i64 @_Z3fooxxx(i64 %x, i64 %y, i64 %z) #0 personality ptr @__gxx_personality_v0 {
15 %call = invoke i64 @_Z3barxxx(i64 %x, i64 %y, i64 %z)
16 to label %try.cont unwind label %lpad
18 lpad: ; preds = %entry
19 %0 = landingpad { ptr, i32 }
21 %1 = extractvalue { ptr, i32 } %0, 0
22 %2 = tail call ptr @__cxa_begin_catch(ptr %1) #1
23 tail call void @__cxa_end_catch()
26 try.cont: ; preds = %entry, %lpad
27 %a.0 = phi i64 [ 0, %lpad ], [ %call, %entry ]
28 %mul = mul nsw i64 %y, %x
29 %sub = sub i64 %mul, %z
30 %add = add nsw i64 %sub, %a.0
34 declare i64 @_Z3barxxx(i64, i64, i64) #0
36 declare i32 @__gxx_personality_v0(...)
38 declare ptr @__cxa_begin_catch(ptr)
40 declare void @__cxa_end_catch()
42 attributes #0 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv60" "target-features"="-hvx" "unsafe-fp-math"="false" "use-soft-float"="false" }
43 attributes #1 = { nounwind }