blob: d06da9346786b56c37f8f86746826c58fe973b6c [file] [log] [blame]
Krzysztof Parzyszekc5a4e262016-04-28 20:33:33 +00001; RUN: llc -march=hexagon < %s | FileCheck %s
2; CHECK: r0 = #24
3; CHECK-NEXT: r1 =
4; // R2 should be assigned a value from R3+.
5; CHECK-NEXT: r2 = r{{[3-9]}}
6; CHECK-NEXT: trap0
7
8target datalayout = "e-m:e-p:32:32:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f64:64:64-f32:32:32-v64:64:64-v32:32:32-a:0-n16:32"
9target triple = "hexagon"
10
11; Function Attrs: nounwind
12define i32 @foo(i32 %status) #0 {
13entry:
14 %arg1 = alloca i32, align 4
15 %0 = bitcast i32* %arg1 to i8*
Matt Arsenaultf10061e2017-04-10 20:18:21 +000016 call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #2
Krzysztof Parzyszekc5a4e262016-04-28 20:33:33 +000017 store i32 %status, i32* %arg1, align 4, !tbaa !1
18 %1 = call i32 asm sideeffect "r0 = #$1\0Ar1 = $2\0Ar2 = $4\0Atrap0 (#0)\0A$0 = r0", "=r,i,r,*m,r,~{r0},~{r1},~{r2}"(i32 24, i32* nonnull %arg1, i32* nonnull %arg1, i32 %status) #2, !srcloc !5
Matt Arsenaultf10061e2017-04-10 20:18:21 +000019 call void @llvm.lifetime.end.p0i8(i64 4, i8* %0) #2
Krzysztof Parzyszekc5a4e262016-04-28 20:33:33 +000020 ret i32 %1
21}
22
23; Function Attrs: argmemonly nounwind
Matt Arsenaultf10061e2017-04-10 20:18:21 +000024declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
Krzysztof Parzyszekc5a4e262016-04-28 20:33:33 +000025
26; Function Attrs: argmemonly nounwind
Matt Arsenaultf10061e2017-04-10 20:18:21 +000027declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
Krzysztof Parzyszekc5a4e262016-04-28 20:33:33 +000028
Sumanth Gundapanenie1983bc2017-10-18 18:07:07 +000029attributes #0 = { nounwind "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-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="hexagonv5" "target-features"="-hvx" "unsafe-fp-math"="false" "use-soft-float"="false" }
Krzysztof Parzyszekc5a4e262016-04-28 20:33:33 +000030attributes #1 = { argmemonly nounwind }
31attributes #2 = { nounwind }
32
33!1 = !{!2, !2, i64 0}
34!2 = !{!"int", !3, i64 0}
35!3 = !{!"omnipotent char", !4, i64 0}
36!4 = !{!"Simple C/C++ TBAA"}
37!5 = !{i32 110, i32 129, i32 146, i32 163, i32 183}