brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1004 B · a779867 Raw
36 lines · plain
1; RUN: llc -mtriple=sparc < %s | FileCheck %s2 3;; Verify that g1 (the output of first asm) is properly understood to4;; be clobbered by the call instruction, and moved out of the way5;; before it. (NOTE: remember delay slot; mov executes before call)6 7; CHECK-LABEL: test1:8; CHECK: ta       99; CHECK: call dosomething10; CHECK: mov      %g1, %i011 12define i32 @test1() nounwind {13entry:14  %0 = tail call i32 asm sideeffect "ta $1", "={r1},i"(i32 9) nounwind15  tail call void @dosomething() nounwind16  ret i32 %017}18 19;; Also check using the value.20; CHECK-LABEL: test2:21; CHECK: ta       922; CHECK: call dosomething23; CHECK: mov      %g1, %i024; CHECK: mov      %i0, %g125; CHECK: ta       1026 27define void @test2() local_unnamed_addr nounwind {28entry:29  %0 = tail call i32 asm sideeffect "ta $1", "={r1},i"(i32 9) nounwind30  tail call void @dosomething() nounwind31  tail call void asm sideeffect "ta $0", "i,{r1}"(i32 10, i32 %0) nounwind32  ret void33}34 35declare void @dosomething() local_unnamed_addr nounwind36