• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=sparc < %s | FileCheck %s
2
3;; Verify that g1 (the output of first asm) is properly understood to
4;; be clobbered by the call instruction, and moved out of the way
5;; before it. (NOTE: remember delay slot; mov executes before call)
6
7; CHECK-LABEL: test1:
8; CHECK: ta       9
9; CHECK: call dosomething
10; CHECK: mov      %g1, %i0
11
12define i32 @test1() nounwind {
13entry:
14  %0 = tail call i32 asm sideeffect "ta $1", "={r1},i"(i32 9) nounwind
15  tail call void @dosomething() nounwind
16  ret i32 %0
17}
18
19;; Also check using the value.
20; CHECK-LABEL: test2:
21; CHECK: ta       9
22; CHECK: call dosomething
23; CHECK: mov      %g1, %i0
24; CHECK: mov      %i0, %g1
25; CHECK: ta       10
26
27define void @test2() local_unnamed_addr nounwind {
28entry:
29  %0 = tail call i32 asm sideeffect "ta $1", "={r1},i"(i32 9) nounwind
30  tail call void @dosomething() nounwind
31  tail call void asm sideeffect "ta $0", "i,{r1}"(i32 10, i32 %0) nounwind
32  ret void
33}
34
35declare void @dosomething() local_unnamed_addr nounwind
36