github.com/goplus/llgo@v0.8.3/cl/_testrt/cast/out.ll (about) 1 ; ModuleID = 'main' 2 source_filename = "main" 3 4 %"github.com/goplus/llgo/internal/runtime.String" = type { ptr, i64 } 5 %"github.com/goplus/llgo/internal/runtime.iface" = type { ptr, ptr } 6 7 @"main.init$guard" = global ptr null 8 @0 = private unnamed_addr constant [6 x i8] c"error\00", align 1 9 @1 = private unnamed_addr constant [6 x i8] c"error\00", align 1 10 @2 = private unnamed_addr constant [6 x i8] c"error\00", align 1 11 @3 = private unnamed_addr constant [6 x i8] c"error\00", align 1 12 @4 = private unnamed_addr constant [6 x i8] c"error\00", align 1 13 @5 = private unnamed_addr constant [6 x i8] c"error\00", align 1 14 @6 = private unnamed_addr constant [6 x i8] c"error\00", align 1 15 @7 = private unnamed_addr constant [6 x i8] c"error\00", align 1 16 @8 = private unnamed_addr constant [6 x i8] c"error\00", align 1 17 @9 = private unnamed_addr constant [6 x i8] c"error\00", align 1 18 @10 = private unnamed_addr constant [6 x i8] c"error\00", align 1 19 @11 = private unnamed_addr constant [6 x i8] c"error\00", align 1 20 @12 = private unnamed_addr constant [6 x i8] c"error\00", align 1 21 @__llgo_argc = global ptr null 22 @__llgo_argv = global ptr null 23 24 define void @main.cvt32Fto32(float %0, i32 %1) { 25 _llgo_0: 26 %2 = fptosi float %0 to i32 27 %3 = icmp ne i32 %2, %1 28 br i1 %3, label %_llgo_1, label %_llgo_2 29 30 _llgo_1: ; preds = %_llgo_0 31 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @0, i64 5) 32 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 33 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 34 unreachable 35 36 _llgo_2: ; preds = %_llgo_0 37 ret void 38 } 39 40 define void @main.cvt32Fto32U(float %0, i32 %1) { 41 _llgo_0: 42 %2 = fptoui float %0 to i32 43 %3 = icmp ne i32 %2, %1 44 br i1 %3, label %_llgo_1, label %_llgo_2 45 46 _llgo_1: ; preds = %_llgo_0 47 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @1, i64 5) 48 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 49 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 50 unreachable 51 52 _llgo_2: ; preds = %_llgo_0 53 ret void 54 } 55 56 define void @main.cvt32Fto64F(float %0, double %1) { 57 _llgo_0: 58 %2 = fpext float %0 to double 59 %3 = fcmp one double %2, %1 60 br i1 %3, label %_llgo_1, label %_llgo_2 61 62 _llgo_1: ; preds = %_llgo_0 63 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @2, i64 5) 64 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 65 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 66 unreachable 67 68 _llgo_2: ; preds = %_llgo_0 69 ret void 70 } 71 72 define void @main.cvt32Fto8(float %0, i8 %1) { 73 _llgo_0: 74 %2 = fptosi float %0 to i8 75 %3 = icmp ne i8 %2, %1 76 br i1 %3, label %_llgo_1, label %_llgo_2 77 78 _llgo_1: ; preds = %_llgo_0 79 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @3, i64 5) 80 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 81 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 82 unreachable 83 84 _llgo_2: ; preds = %_llgo_0 85 ret void 86 } 87 88 define void @main.cvt32Fto8U(float %0, i8 %1) { 89 _llgo_0: 90 %2 = fptoui float %0 to i8 91 %3 = icmp ne i8 %2, %1 92 br i1 %3, label %_llgo_1, label %_llgo_2 93 94 _llgo_1: ; preds = %_llgo_0 95 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @4, i64 5) 96 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 97 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 98 unreachable 99 100 _llgo_2: ; preds = %_llgo_0 101 ret void 102 } 103 104 define void @main.cvt32to64(i32 %0, i64 %1) { 105 _llgo_0: 106 %2 = sext i32 %0 to i64 107 %3 = icmp ne i64 %2, %1 108 br i1 %3, label %_llgo_1, label %_llgo_2 109 110 _llgo_1: ; preds = %_llgo_0 111 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @5, i64 5) 112 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 113 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 114 unreachable 115 116 _llgo_2: ; preds = %_llgo_0 117 ret void 118 } 119 120 define void @main.cvt64Fto32F(double %0, float %1) { 121 _llgo_0: 122 %2 = fptrunc double %0 to float 123 %3 = fcmp one float %2, %1 124 br i1 %3, label %_llgo_1, label %_llgo_2 125 126 _llgo_1: ; preds = %_llgo_0 127 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @6, i64 5) 128 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 129 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 130 unreachable 131 132 _llgo_2: ; preds = %_llgo_0 133 ret void 134 } 135 136 define void @main.cvt64Uto64F(i64 %0, double %1) { 137 _llgo_0: 138 %2 = uitofp i64 %0 to double 139 %3 = fcmp one double %2, %1 140 br i1 %3, label %_llgo_1, label %_llgo_2 141 142 _llgo_1: ; preds = %_llgo_0 143 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @7, i64 5) 144 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 145 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 146 unreachable 147 148 _llgo_2: ; preds = %_llgo_0 149 ret void 150 } 151 152 define void @main.cvt64to64F(i64 %0, double %1) { 153 _llgo_0: 154 %2 = sitofp i64 %0 to double 155 %3 = fcmp one double %2, %1 156 br i1 %3, label %_llgo_1, label %_llgo_2 157 158 _llgo_1: ; preds = %_llgo_0 159 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @8, i64 5) 160 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 161 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 162 unreachable 163 164 _llgo_2: ; preds = %_llgo_0 165 ret void 166 } 167 168 define void @main.cvt64to8(i64 %0, i8 %1) { 169 _llgo_0: 170 %2 = trunc i64 %0 to i8 171 %3 = icmp ne i8 %2, %1 172 br i1 %3, label %_llgo_1, label %_llgo_2 173 174 _llgo_1: ; preds = %_llgo_0 175 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @9, i64 5) 176 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 177 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 178 unreachable 179 180 _llgo_2: ; preds = %_llgo_0 181 ret void 182 } 183 184 define void @main.cvt64to8U(i64 %0, i8 %1) { 185 _llgo_0: 186 %2 = trunc i64 %0 to i8 187 %3 = icmp ne i8 %2, %1 188 br i1 %3, label %_llgo_1, label %_llgo_2 189 190 _llgo_1: ; preds = %_llgo_0 191 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @10, i64 5) 192 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 193 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 194 unreachable 195 196 _llgo_2: ; preds = %_llgo_0 197 ret void 198 } 199 200 define void @main.cvtUinptr(i32 %0, i64 %1) { 201 _llgo_0: 202 %2 = zext i32 %0 to i64 203 %3 = icmp ne i64 %2, %1 204 br i1 %3, label %_llgo_1, label %_llgo_2 205 206 _llgo_1: ; preds = %_llgo_0 207 %4 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @11, i64 5) 208 %5 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %4) 209 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %5) 210 unreachable 211 212 _llgo_2: ; preds = %_llgo_0 213 %6 = trunc i64 %1 to i32 214 %7 = icmp ne i32 %6, %0 215 br i1 %7, label %_llgo_3, label %_llgo_4 216 217 _llgo_3: ; preds = %_llgo_2 218 %8 = call %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr @12, i64 5) 219 %9 = call %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String" %8) 220 call void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface" %9) 221 unreachable 222 223 _llgo_4: ; preds = %_llgo_2 224 ret void 225 } 226 227 define void @main.init() { 228 _llgo_0: 229 %0 = load i1, ptr @"main.init$guard", align 1 230 br i1 %0, label %_llgo_2, label %_llgo_1 231 232 _llgo_1: ; preds = %_llgo_0 233 store i1 true, ptr @"main.init$guard", align 1 234 br label %_llgo_2 235 236 _llgo_2: ; preds = %_llgo_1, %_llgo_0 237 ret void 238 } 239 240 define i32 @main(i32 %0, ptr %1) { 241 _llgo_0: 242 store i32 %0, ptr @__llgo_argc, align 4 243 store ptr %1, ptr @__llgo_argv, align 8 244 call void @"github.com/goplus/llgo/internal/runtime.init"() 245 call void @main.init() 246 call void @main.cvt64to8(i64 0, i8 0) 247 call void @main.cvt64to8(i64 127, i8 127) 248 call void @main.cvt64to8(i64 128, i8 -128) 249 call void @main.cvt64to8(i64 -128, i8 -128) 250 call void @main.cvt64to8(i64 -129, i8 127) 251 call void @main.cvt64to8(i64 256, i8 0) 252 call void @main.cvt64to8U(i64 0, i8 0) 253 call void @main.cvt64to8U(i64 255, i8 -1) 254 call void @main.cvt64to8U(i64 256, i8 0) 255 call void @main.cvt64to8U(i64 257, i8 1) 256 call void @main.cvt64to8U(i64 -1, i8 -1) 257 call void @main.cvt32Fto8(float 0x3FB99999A0000000, i8 0) 258 call void @main.cvt32Fto8(float 0x405FC66660000000, i8 127) 259 call void @main.cvt32Fto8(float 0x4060033340000000, i8 -128) 260 call void @main.cvt32Fto8(float 0xC060033340000000, i8 -128) 261 call void @main.cvt32Fto8(float 0xC060233340000000, i8 127) 262 call void @main.cvt32Fto8(float 0x40700199A0000000, i8 0) 263 call void @main.cvt32Fto8U(float 0.000000e+00, i8 0) 264 call void @main.cvt32Fto8U(float 2.550000e+02, i8 -1) 265 call void @main.cvt32Fto8U(float 2.560000e+02, i8 0) 266 call void @main.cvt32Fto8U(float 2.570000e+02, i8 1) 267 call void @main.cvt32Fto8U(float -1.000000e+00, i8 -1) 268 call void @main.cvt32Fto32(float 0.000000e+00, i32 0) 269 call void @main.cvt32Fto32(float 1.500000e+00, i32 1) 270 call void @main.cvt32Fto32(float 0x41D1194D80000000, i32 1147483648) 271 call void @main.cvt32Fto32(float 0x41E0000000000000, i32 -2147483648) 272 call void @main.cvt32Fto32(float 0x41EEE6B280000000, i32 -2147483648) 273 call void @main.cvt32Fto32(float 0xC1E0000000000000, i32 -2147483648) 274 call void @main.cvt32Fto32(float 0xC1DFFFFF00000000, i32 -2147482624) 275 call void @main.cvt32Fto32U(float 0.000000e+00, i32 0) 276 call void @main.cvt32Fto32U(float 1.500000e+00, i32 1) 277 call void @main.cvt32Fto32U(float 0x41F0000000000000, i32 0) 278 call void @main.cvt32Fto32U(float 0x41F3B9ACA0000000, i32 1000000000) 279 call void @main.cvt32Fto32U(float 0xC1F0000000000000, i32 0) 280 call void @main.cvt32Fto32U(float 0xC1D34BE880000000, i32 -1294967296) 281 call void @main.cvt32Fto32U(float 0xBFF19999A0000000, i32 -1) 282 call void @main.cvt32Fto64F(float 0.000000e+00, double 0.000000e+00) 283 call void @main.cvt32Fto64F(float 1.500000e+00, double 1.500000e+00) 284 call void @main.cvt32Fto64F(float 1.000000e+10, double 1.000000e+10) 285 call void @main.cvt32Fto64F(float -1.000000e+10, double -1.000000e+10) 286 call void @main.cvt64Fto32F(double 0.000000e+00, float 0.000000e+00) 287 call void @main.cvt64Fto32F(double 1.500000e+00, float 1.500000e+00) 288 call void @main.cvt64Fto32F(double 1.000000e+10, float 1.000000e+10) 289 call void @main.cvt64Fto32F(double -1.000000e+10, float -1.000000e+10) 290 call void @main.cvt64to64F(i64 0, double 0.000000e+00) 291 call void @main.cvt64to64F(i64 10000000000, double 1.000000e+10) 292 call void @main.cvt64to64F(i64 9223372036854775807, double 0x43E0000000000000) 293 call void @main.cvt64to64F(i64 -9223372036854775807, double 0xC3E0000000000000) 294 call void @main.cvt64Uto64F(i64 0, double 0.000000e+00) 295 call void @main.cvt64Uto64F(i64 10000000000, double 1.000000e+10) 296 call void @main.cvt64Uto64F(i64 9223372036854775807, double 0x43E0000000000000) 297 call void @main.cvt64Uto64F(i64 -1, double 0x43F0000000000000) 298 call void @main.cvt32to64(i32 0, i64 0) 299 call void @main.cvt32to64(i32 2147483647, i64 2147483647) 300 call void @main.cvtUinptr(i32 1024, i64 1024) 301 ret i32 0 302 } 303 304 declare %"github.com/goplus/llgo/internal/runtime.String" @"github.com/goplus/llgo/internal/runtime.NewString"(ptr, i64) 305 306 declare %"github.com/goplus/llgo/internal/runtime.iface" @"github.com/goplus/llgo/internal/runtime.MakeAnyString"(%"github.com/goplus/llgo/internal/runtime.String") 307 308 declare void @"github.com/goplus/llgo/internal/runtime.TracePanic"(%"github.com/goplus/llgo/internal/runtime.iface") 309 310 declare void @"github.com/goplus/llgo/internal/runtime.init"()