blob: ae2d65eb2b6179adc85f1614bc0121906ef3081c [file] [log] [blame]
Michael Kuperstein5f843032014-09-23 08:48:01 +00001; RUN: llvm-dis < %s.bc| FileCheck %s
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +00002
Michael Kuperstein5f843032014-09-23 08:48:01 +00003; conversionInstructions.3.2.ll.bc was generated by passing this file to llvm-as-3.2.
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +00004; The test checks that LLVM does not misread conversion instructions from
5; older bitcode files.
6
7define void @trunc(i32 %src){
8entry:
9; CHECK: %res1 = trunc i32 %src to i8
10 %res1 = trunc i32 %src to i8
Michael Kuperstein5f843032014-09-23 08:48:01 +000011
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000012 ret void
13}
14
15define void @zext(i32 %src){
16entry:
17; CHECK: %res1 = zext i32 %src to i64
18 %res1 = zext i32 %src to i64
Michael Kuperstein5f843032014-09-23 08:48:01 +000019
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000020 ret void
21}
22
23define void @sext(i32 %src){
24entry:
25; CHECK: %res1 = sext i32 %src to i64
26 %res1 = sext i32 %src to i64
Michael Kuperstein5f843032014-09-23 08:48:01 +000027
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000028 ret void
29}
30
31define void @fptrunc(double %src){
32entry:
33; CHECK: %res1 = fptrunc double %src to float
34 %res1 = fptrunc double %src to float
Michael Kuperstein5f843032014-09-23 08:48:01 +000035
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000036 ret void
37}
38
39define void @fpext(float %src){
40entry:
41; CHECK: %res1 = fpext float %src to double
42 %res1 = fpext float %src to double
Michael Kuperstein5f843032014-09-23 08:48:01 +000043
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000044 ret void
45}
46
47define void @fptoui(float %src){
48entry:
49; CHECK: %res1 = fptoui float %src to i32
50 %res1 = fptoui float %src to i32
Michael Kuperstein5f843032014-09-23 08:48:01 +000051
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000052 ret void
53}
54
55define void @fptosi(float %src){
56entry:
57; CHECK: %res1 = fptosi float %src to i32
58 %res1 = fptosi float %src to i32
Michael Kuperstein5f843032014-09-23 08:48:01 +000059
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000060 ret void
61}
62
63define void @uitofp(i32 %src){
64entry:
65; CHECK: %res1 = uitofp i32 %src to float
66 %res1 = uitofp i32 %src to float
Michael Kuperstein5f843032014-09-23 08:48:01 +000067
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000068 ret void
69}
70
71define void @sitofp(i32 %src){
72entry:
73; CHECK: %res1 = sitofp i32 %src to float
74 %res1 = sitofp i32 %src to float
Michael Kuperstein5f843032014-09-23 08:48:01 +000075
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000076 ret void
77}
78
79define void @ptrtoint(i32* %src){
80entry:
81; CHECK: %res1 = ptrtoint i32* %src to i8
82 %res1 = ptrtoint i32* %src to i8
Michael Kuperstein5f843032014-09-23 08:48:01 +000083
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000084 ret void
85}
86
87define void @inttoptr(i32 %src){
88entry:
89; CHECK: %res1 = inttoptr i32 %src to i32*
90 %res1 = inttoptr i32 %src to i32*
Michael Kuperstein5f843032014-09-23 08:48:01 +000091
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +000092 ret void
93}
94
95define void @bitcast(i32 %src1, i32* %src2){
96entry:
97; CHECK: %res1 = bitcast i32 %src1 to i32
98 %res1 = bitcast i32 %src1 to i32
Michael Kuperstein5f843032014-09-23 08:48:01 +000099
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +0000100; CHECK: %res2 = bitcast i32* %src2 to i64*
101 %res2 = bitcast i32* %src2 to i64*
Michael Kuperstein5f843032014-09-23 08:48:01 +0000102
103 ret void
104}
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +0000105
Michael Kuperstein5f843032014-09-23 08:48:01 +0000106define void @ptrtointInstr(i32* %ptr, <4 x i32*> %vecPtr){
107entry:
108; CHECK: %res1 = ptrtoint i32* %ptr to i8
109 %res1 = ptrtoint i32* %ptr to i8
110; CHECK-NEXT: %res2 = ptrtoint <4 x i32*> %vecPtr to <4 x i64>
111 %res2 = ptrtoint <4 x i32*> %vecPtr to <4 x i64>
112
113 ret void
114}
115
116define void @inttoptrInstr(i32 %x, <4 x i32> %vec){
117entry:
118; CHECK: %res1 = inttoptr i32 %x to i64*
119 %res1 = inttoptr i32 %x to i64*
120; CHECK-NEXT: inttoptr <4 x i32> %vec to <4 x i8*>
121 %res2 = inttoptr <4 x i32> %vec to <4 x i8*>
122
Duncan P. N. Exon Smith15f92a32014-07-29 01:10:57 +0000123 ret void
124}