brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 201c5ea Raw
50 lines · plain
1; RUN: llc < %s -mtriple x86_64-apple-darwin11 -O0 -fast-isel-abort=1 | FileCheck %s2 3%struct.x = type { i64, i64 }4declare %struct.x @f()5 6define void @test1(ptr) nounwind ssp {7  %2 = tail call %struct.x @f() nounwind8  %3 = extractvalue %struct.x %2, 09  %4 = add i64 %3, 1010  store i64 %4, ptr %011  ret void12; CHECK-LABEL: test1:13; CHECK: callq _f14; CHECK-NOT: %rax15; CHECK: addq $10, %rax16}17 18define void @test2(ptr) nounwind ssp {19  %2 = tail call %struct.x @f() nounwind20  %3 = extractvalue %struct.x %2, 121  %4 = add i64 %3, 1022  store i64 %4, ptr %023  ret void24; CHECK-LABEL: test2:25; CHECK: callq _f26; CHECK-NOT: %rdx27; CHECK: addq $10, %rdx28}29 30declare { i32, i1 } @llvm.sadd.with.overflow.i32(i32, i32) nounwind readnone31 32define void @test3(i32 %x, i32 %y, ptr %z) {33  %r = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %x, i32 %y)34  %sum = extractvalue { i32, i1 } %r, 035  %sum3 = mul i32 %sum, 336  %bit = extractvalue { i32, i1 } %r, 137  br i1 %bit, label %then, label %end38  39then:40  store i32 %sum3, ptr %z41  br label %end42 43end:44  ret void45; CHECK: test346; CHECK: addl47; CHECK: seto %al48; CHECK: testb $1, %al49}50