diff options
author | Venkatraman Govindaraju <venkatra@cs.wisc.edu> | 2013-09-22 00:42:30 +0000 |
---|---|---|
committer | Venkatraman Govindaraju <venkatra@cs.wisc.edu> | 2013-09-22 00:42:30 +0000 |
commit | c12c8d754dcf7793d924c01517c9f6f297fdf6b4 (patch) | |
tree | d6506383fe21e26db1a3a57842719fa364639a8c /test | |
parent | 50019d8f7e1af96b85098ba501acbb9845682e4a (diff) | |
download | external_llvm-c12c8d754dcf7793d924c01517c9f6f297fdf6b4.zip external_llvm-c12c8d754dcf7793d924c01517c9f6f297fdf6b4.tar.gz external_llvm-c12c8d754dcf7793d924c01517c9f6f297fdf6b4.tar.bz2 |
[Sparc] Emit .register directive to declare the use of global registers %g2, %g4, %g6 and %g7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/SPARC/64abi.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/SPARC/64abi.ll b/test/CodeGen/SPARC/64abi.ll index 5a7eb40..00fb99a 100644 --- a/test/CodeGen/SPARC/64abi.ll +++ b/test/CodeGen/SPARC/64abi.ll @@ -376,3 +376,19 @@ define signext i32 @ret_nosext(i32 signext %a0) { define signext i32 @ret_nozext(i32 signext %a0) { ret i32 %a0 } + +; CHECK-LABEL: test_register_directive +; CHECK: .register %g2, #scratch +; CHECK: .register %g3, #scratch +; CHECK: .register %g6, #ignore +; CHECK: .register %g7, #ignore +; CHECK: add %i0, 2, %g2 +; CHECK: add %i0, 3, %g3 +define i32 @test_register_directive(i32 %i0) { +entry: + %0 = add nsw i32 %i0, 2 + %1 = add nsw i32 %i0, 3 + tail call void asm sideeffect "", "r,r,~{l0},~{l1},~{l2},~{l3},~{l4},~{l5},~{l6},~{l7},~{i0},~{i1},~{i2},~{i3},~{i4},~{i5},~{i6},~{i7},~{o0},~{o1},~{o2},~{o3},~{o4},~{o5},~{o6},~{o7},~{g1},~{g4},~{g5},~{g6},~{g7}"(i32 %0, i32 %1) + %2 = add nsw i32 %0, %1 + ret i32 %2 +} |