132 lines · plain
1; RUN: llc < %s -fast-isel -fast-isel-abort=1 -verify-machineinstrs -mtriple=i686-- -mattr=sse2 -no-integrated-as2; RUN: llc < %s -fast-isel -fast-isel-abort=1 -verify-machineinstrs -mtriple=x86_64-apple-darwin10 -no-integrated-as3 4; This tests very minimal fast-isel functionality.5 6define ptr @foo(ptr %p, ptr %q, ptr %z) nounwind {7entry:8 %r = load i32, ptr %p9 %s = load i32, ptr %q10 %y = load ptr, ptr %z11 br label %fast12 13fast:14 %t0 = add i32 %r, %s15 %t1 = mul i32 %t0, %s16 %t2 = sub i32 %t1, %s17 %t3 = and i32 %t2, %s18 %t4 = xor i32 %t3, 319 %t5 = xor i32 %t4, %s20 %t6 = add i32 %t5, 221 %t7 = getelementptr i32, ptr %y, i32 122 %t8 = getelementptr i32, ptr %t7, i32 %t623 call void asm sideeffect "hello world", ""()24 br label %exit25 26exit:27 ret ptr %t828}29 30define void @bar(ptr %p, ptr %q) nounwind {31entry:32 %r = load double, ptr %p33 %s = load double, ptr %q34 br label %fast35 36fast:37 %t0 = fadd double %r, %s38 %t1 = fmul double %t0, %s39 %t2 = fsub double %t1, %s40 %t3 = fadd double %t2, 707.041 br label %exit42 43exit:44 store double %t3, ptr %q45 ret void46}47 48define i32 @cast() nounwind {49entry:50 %tmp2 = bitcast i32 0 to i3251 ret i32 %tmp252}53 54define void @ptrtoint_i1(ptr %p, ptr %q) nounwind {55 %t = ptrtoint ptr %p to i156 store i1 %t, ptr %q57 ret void58}59define ptr @inttoptr_i1(i1 %p) nounwind {60 %t = inttoptr i1 %p to ptr61 ret ptr %t62}63define i32 @ptrtoint_i32(ptr %p) nounwind {64 %t = ptrtoint ptr %p to i3265 ret i32 %t66}67define ptr @inttoptr_i32(i32 %p) nounwind {68 %t = inttoptr i32 %p to ptr69 ret ptr %t70}71 72define void @trunc_i32_i8(i32 %x, ptr %p) nounwind {73 %tmp1 = trunc i32 %x to i874 store i8 %tmp1, ptr %p75 ret void76}77 78define void @trunc_i16_i8(i16 signext %x, ptr %p) nounwind {79 %tmp1 = trunc i16 %x to i880 store i8 %tmp1, ptr %p81 ret void82}83 84define void @shl_i8(i8 %a, i8 %c, ptr %p) nounwind {85 %tmp = shl i8 %a, %c86 store i8 %tmp, ptr %p87 ret void88}89 90define void @mul_i8(i8 %a, ptr %p) nounwind {91 %tmp = mul i8 %a, 1792 store i8 %tmp, ptr %p93 ret void94}95 96define void @load_store_i1(ptr %p, ptr %q) nounwind {97 %t = load i1, ptr %p98 store i1 %t, ptr %q99 ret void100}101 102define void @freeze_i32(i32 %x) {103 %t = freeze i32 %x104 ret void105}106 107@crash_test1x = external global <2 x i32>, align 8108 109define void @crash_test1() nounwind ssp {110 %tmp = load <2 x i32>, ptr @crash_test1x, align 8111 %neg = xor <2 x i32> %tmp, <i32 -1, i32 -1>112 ret void113}114 115declare void @llvm.lifetime.start.p0(i64, ptr nocapture) nounwind116 117define ptr @life() nounwind {118 %a1 = alloca ptr, align 8119 call void @llvm.lifetime.start.p0(i64 -1, ptr %a1) nounwind 120 %a3 = load ptr, ptr %a1, align 8121 ret ptr %a3122}123 124declare void @llvm.donothing() readnone125 126; CHECK: donada127define void @donada() nounwind {128entry:129 call void @llvm.donothing()130 ret void131}132