brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 3cd6017 Raw
61 lines · plain
1; RUN: %lli -jit-kind=mcjit -force-interpreter=true %s | FileCheck %s2; CHECK: 13 4target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"5target triple = "i686-pc-linux-gnu"6@.str = internal constant [10 x i8] c"MSB = %d\0A\00"		; <ptr> [#uses=1]7 8define i65 @foo(i65 %x) {9entry:10	%x_addr = alloca i65		; <ptr> [#uses=2]11	%retval = alloca i65		; <ptr> [#uses=2]12	%tmp = alloca i65		; <ptr> [#uses=2]13	%"alloca point" = bitcast i65 0 to i65		; <i65> [#uses=0]14	store i65 %x, ptr %x_addr15	%tmp1 = load i65, ptr %x_addr, align 4		; <i65> [#uses=1]16	%tmp2 = ashr i65 %tmp1, 65		; <i65> [#uses=1]17	store i65 %tmp2, ptr %tmp, align 418	%tmp3 = load i65, ptr %tmp, align 4		; <i65> [#uses=1]19	store i65 %tmp3, ptr %retval, align 420	br label %return21 22return:		; preds = %entry23	%retval4 = load i65, ptr %retval		; <i65> [#uses=1]24	ret i65 %retval425}26 27define i32 @main() {28entry:29	%retval = alloca i32		; <ptr> [#uses=1]30	%iftmp.0 = alloca i32		; <ptr> [#uses=3]31	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]32	%tmp = call i65 @foo( i65 -9 )		; <i65> [#uses=1]33	%tmp1 = lshr i65 %tmp, 64		; <i65> [#uses=1]34	%tmp2 = xor i65 %tmp1, 1		; <i65> [#uses=1]35	%tmp3 = and i65 %tmp2, 1		; <i65> [#uses=1]36	%tmp34 = trunc i65 %tmp3 to i8		; <i8> [#uses=1]37	%toBool = icmp ne i8 %tmp34, 0		; <i1> [#uses=1]38	br i1 %toBool, label %cond_true, label %cond_false39 40cond_true:		; preds = %entry41	store i32 0, ptr %iftmp.0, align 442	br label %cond_next43 44cond_false:		; preds = %entry45	store i32 1, ptr %iftmp.0, align 446	br label %cond_next47 48cond_next:		; preds = %cond_false, %cond_true49	%tmp5 = getelementptr [10 x i8], ptr @.str, i32 0, i32 0		; <ptr> [#uses=1]50	%tmp6 = load i32, ptr %iftmp.0, align 4		; <i32> [#uses=1]51	%tmp7 = call i32 (ptr, ...) @printf( ptr noalias  %tmp5, i32 %tmp6 ) nounwind 		; <i32> [#uses=0]52	br label %return53 54return:		; preds = %cond_next55    store i32 0, ptr %retval, align 456	%retval8 = load i32, ptr %retval		; <i32> [#uses=1]57	ret i32 %retval858}59 60declare i32 @printf(ptr noalias , ...) nounwind 61