Krzysztof Parzyszek | c2c7868 | 2016-05-11 14:53:07 +0000 | [diff] [blame^] | 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 |
| 6 | ; R30+8. |
| 7 | |
| 8 | ; CHECK: cfi_def_cfa r30 |
| 9 | ; CHECK-NOT: .cfi_offset r{{[0-9]+}}, {{[^-]}} |
| 10 | |
| 11 | target triple = "hexagon" |
| 12 | |
| 13 | define i64 @_Z3fooxxx(i64 %x, i64 %y, i64 %z) #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { |
| 14 | entry: |
| 15 | %call = invoke i64 @_Z3barxxx(i64 %x, i64 %y, i64 %z) |
| 16 | to label %try.cont unwind label %lpad |
| 17 | |
| 18 | lpad: ; preds = %entry |
| 19 | %0 = landingpad { i8*, i32 } |
| 20 | catch i8* null |
| 21 | %1 = extractvalue { i8*, i32 } %0, 0 |
| 22 | %2 = tail call i8* @__cxa_begin_catch(i8* %1) #1 |
| 23 | tail call void @__cxa_end_catch() |
| 24 | br label %try.cont |
| 25 | |
| 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 |
| 31 | ret i64 %add |
| 32 | } |
| 33 | |
| 34 | declare i64 @_Z3barxxx(i64, i64, i64) #0 |
| 35 | |
| 36 | declare i32 @__gxx_personality_v0(...) |
| 37 | |
| 38 | declare i8* @__cxa_begin_catch(i8*) |
| 39 | |
| 40 | declare void @__cxa_end_catch() |
| 41 | |
| 42 | attributes #0 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "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,-hvx-double" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 43 | attributes #1 = { nounwind } |