Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/X86/statepoint-call-lowering.ll @ 83:60c9769439b8 LLVM3.7
LLVM 3.7
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Feb 2015 14:55:36 +0900 |
parents | |
children | afa8332a0e37 |
comparison
equal
deleted
inserted
replaced
78:af83660cff7b | 83:60c9769439b8 |
---|---|
1 ; RUN: llc < %s | FileCheck %s | |
2 ; This file contains a collection of basic tests to ensure we didn't | |
3 ; screw up normal call lowering when there are no deopt or gc arguments. | |
4 | |
5 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128" | |
6 target triple = "x86_64-pc-linux-gnu" | |
7 | |
8 declare zeroext i1 @return_i1() | |
9 declare zeroext i32 @return_i32() | |
10 declare i32* @return_i32ptr() | |
11 declare float @return_float() | |
12 declare void @varargf(i32, ...) | |
13 | |
14 define i1 @test_i1_return() gc "statepoint-example" { | |
15 ; CHECK-LABEL: test_i1_return | |
16 ; This is just checking that a i1 gets lowered normally when there's no extra | |
17 ; state arguments to the statepoint | |
18 ; CHECK: pushq %rax | |
19 ; CHECK: callq return_i1 | |
20 ; CHECK: popq %rdx | |
21 ; CHECK: retq | |
22 entry: | |
23 %safepoint_token = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0) | |
24 %call1 = call zeroext i1 @llvm.experimental.gc.result.i1(i32 %safepoint_token) | |
25 ret i1 %call1 | |
26 } | |
27 | |
28 define i32 @test_i32_return() gc "statepoint-example" { | |
29 ; CHECK-LABEL: test_i32_return | |
30 ; CHECK: pushq %rax | |
31 ; CHECK: callq return_i32 | |
32 ; CHECK: popq %rdx | |
33 ; CHECK: retq | |
34 entry: | |
35 %safepoint_token = tail call i32 (i32 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i32f(i32 ()* @return_i32, i32 0, i32 0, i32 0) | |
36 %call1 = call zeroext i32 @llvm.experimental.gc.result.i32(i32 %safepoint_token) | |
37 ret i32 %call1 | |
38 } | |
39 | |
40 define i32* @test_i32ptr_return() gc "statepoint-example" { | |
41 ; CHECK-LABEL: test_i32ptr_return | |
42 ; CHECK: pushq %rax | |
43 ; CHECK: callq return_i32ptr | |
44 ; CHECK: popq %rdx | |
45 ; CHECK: retq | |
46 entry: | |
47 %safepoint_token = tail call i32 (i32* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p0i32f(i32* ()* @return_i32ptr, i32 0, i32 0, i32 0) | |
48 %call1 = call i32* @llvm.experimental.gc.result.p0i32(i32 %safepoint_token) | |
49 ret i32* %call1 | |
50 } | |
51 | |
52 define float @test_float_return() gc "statepoint-example" { | |
53 ; CHECK-LABEL: test_float_return | |
54 ; CHECK: pushq %rax | |
55 ; CHECK: callq return_float | |
56 ; CHECK: popq %rax | |
57 ; CHECK: retq | |
58 entry: | |
59 %safepoint_token = tail call i32 (float ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_f32f(float ()* @return_float, i32 0, i32 0, i32 0) | |
60 %call1 = call float @llvm.experimental.gc.result.f32(i32 %safepoint_token) | |
61 ret float %call1 | |
62 } | |
63 | |
64 define i1 @test_relocate(i32 addrspace(1)* %a) gc "statepoint-example" { | |
65 ; CHECK-LABEL: test_relocate | |
66 ; Check that an ununsed relocate has no code-generation impact | |
67 ; CHECK: pushq %rax | |
68 ; CHECK: callq return_i1 | |
69 ; CHECK-NEXT: .Ltmp13: | |
70 ; CHECK-NEXT: popq %rdx | |
71 ; CHECK-NEXT: retq | |
72 entry: | |
73 %safepoint_token = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 addrspace(1)* %a) | |
74 %call1 = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 4, i32 4) | |
75 %call2 = call zeroext i1 @llvm.experimental.gc.result.i1(i32 %safepoint_token) | |
76 ret i1 %call2 | |
77 } | |
78 | |
79 define void @test_void_vararg() gc "statepoint-example" { | |
80 ; CHECK-LABEL: test_void_vararg | |
81 ; Check a statepoint wrapping a *void* returning vararg function works | |
82 ; CHECK: callq varargf | |
83 entry: | |
84 %safepoint_token = tail call i32 (void (i32, ...)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidi32varargf(void (i32, ...)* @varargf, i32 2, i32 0, i32 42, i32 43, i32 0) | |
85 ;; if we try to use the result from a statepoint wrapping a | |
86 ;; non-void-returning varargf, we will experience a crash. | |
87 ret void | |
88 } | |
89 | |
90 declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...) | |
91 declare i1 @llvm.experimental.gc.result.i1(i32) | |
92 | |
93 declare i32 @llvm.experimental.gc.statepoint.p0f_i32f(i32 ()*, i32, i32, ...) | |
94 declare i32 @llvm.experimental.gc.result.i32(i32) | |
95 | |
96 declare i32 @llvm.experimental.gc.statepoint.p0f_p0i32f(i32* ()*, i32, i32, ...) | |
97 declare i32* @llvm.experimental.gc.result.p0i32(i32) | |
98 | |
99 declare i32 @llvm.experimental.gc.statepoint.p0f_f32f(float ()*, i32, i32, ...) | |
100 declare float @llvm.experimental.gc.result.f32(i32) | |
101 | |
102 declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidi32varargf(void (i32, ...)*, i32, i32, ...) | |
103 | |
104 declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32) |