diff options
Diffstat (limited to 'test/CodeGen/SPARC/64abi.ll')
-rw-r--r-- | test/CodeGen/SPARC/64abi.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGen/SPARC/64abi.ll b/test/CodeGen/SPARC/64abi.ll index 5a7eb40..8b752a1 100644 --- a/test/CodeGen/SPARC/64abi.ll +++ b/test/CodeGen/SPARC/64abi.ll @@ -376,3 +376,38 @@ 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: 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 +} + +; CHECK-LABEL: test_large_stack + +; CHECK: sethi 16, %g1 +; CHECK: xor %g1, -176, %g1 +; CHECK: save %sp, %g1, %sp + +; CHECK: sethi 14, %g1 +; CHECK: xor %g1, -1, %g1 +; CHECK: add %g1, %fp, %g1 +; CHECK: call use_buf + +define i32 @test_large_stack() { +entry: + %buffer1 = alloca [16384 x i8], align 8 + %buffer1.sub = getelementptr inbounds [16384 x i8]* %buffer1, i32 0, i32 0 + %0 = call i32 @use_buf(i32 16384, i8* %buffer1.sub) + ret i32 %0 +} + +declare i32 @use_buf(i32, i8*) |