brintos

brintos / llvm-project-archived public Read only

0
0
Text · 952 B · f4c658b Raw
43 lines · plain
1; RUN: llc < %s -mtriple=i686-apple-darwin10 -fast-isel -fast-isel-abort=1 | FileCheck %s2; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -fast-isel -fast-isel-abort=1 | FileCheck %s3 4declare i32 @test1a(i32)5 6define i32 @test1(i32 %x) nounwind {7; CHECK-LABEL: test1:8; CHECK: andb $1, %9	%y = add i32 %x, -310	%t = call i32 @test1a(i32 %y)11	%s = mul i32 %t, 7712	%z = trunc i32 %s to i113	br label %next14 15next:		; preds = %016	%u = zext i1 %z to i3217	%v = add i32 %u, 199918	br label %exit19 20exit:		; preds = %next21	ret i32 %v22}23 24define void @test2(ptr %a) nounwind {25entry:26; clang uses i8 constants for booleans, so we test with an i8 1.27; CHECK-LABEL: test2:28; CHECK: movzbl {{.*}} %eax29; CHECK-NEXT: xorb $1, %al30; CHECK-NEXT: testb $131  %tmp = load i8, ptr %a, align 132  %xor = xor i8 %tmp, 133  %tobool = trunc i8 %xor to i134  br i1 %tobool, label %if.then, label %if.end35 36if.then:37  call void @test2(ptr null)38  br label %if.end39 40if.end:41  ret void42}43