| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -fast-isel -fast-isel-abort=3 < %s | FileCheck %s | |
| declare { i32, i32 } @get_i32s() | |
| define i32 @call_get_i32s() nounwind { | |
| ; CHECK-LABEL: call_get_i32s: | |
| ; CHECK: # %bb.0: | |
| ; CHECK-NEXT: pushq %rax | |
| ; CHECK-NEXT: callq get_i32s@PLT | |
| ; CHECK-NEXT: addl %edx, %eax | |
| ; CHECK-NEXT: popq %rcx | |
| ; CHECK-NEXT: retq | |
| %res = call { i32, i32 } @get_i32s() | |
| %res.0 = extractvalue { i32, i32 } %res, 0 | |
| %res.1 = extractvalue { i32, i32 } %res, 1 | |
| %add = add i32 %res.0, %res.1 | |
| ret i32 %add | |
| } | |
| declare { ptr, ptr } @get_ptrs() | |
| define i64 @call_get_ptrs() nounwind { | |
| ; CHECK-LABEL: call_get_ptrs: | |
| ; CHECK: # %bb.0: | |
| ; CHECK-NEXT: pushq %rax | |
| ; CHECK-NEXT: callq get_ptrs@PLT | |
| ; CHECK-NEXT: subq %rdx, %rax | |
| ; CHECK-NEXT: popq %rcx | |
| ; CHECK-NEXT: retq | |
| %res = call { ptr, ptr } @get_ptrs() | |
| %res.0 = extractvalue { ptr, ptr } %res, 0 | |
| %res.1 = extractvalue { ptr, ptr } %res, 1 | |
| %res.0.addr = ptrtoaddr ptr %res.0 to i64 | |
| %res.1.addr = ptrtoaddr ptr %res.1 to i64 | |
| %sub = sub i64 %res.0.addr, %res.1.addr | |
| ret i64 %sub | |
| } | |
| declare { i64, i1 } @get_i64_and_bool() | |
| define i64 @call_get_i64_and_bool() nounwind { | |
| ; CHECK-LABEL: call_get_i64_and_bool: | |
| ; CHECK: # %bb.0: | |
| ; CHECK-NEXT: pushq %rax | |
| ; CHECK-NEXT: callq get_i64_and_bool@PLT | |
| ; CHECK-NEXT: andb $1, %dl | |
| ; CHECK-NEXT: movzbl %dl, %ecx | |
| ; CHECK-NEXT: addq %rcx, %rax | |
| ; CHECK-NEXT: popq %rcx | |
| ; CHECK-NEXT: retq | |
| %res = call { i64, i1 } @get_i64_and_bool() | |
| %res.0 = extractvalue { i64, i1 } %res, 0 | |
| %res.1 = extractvalue { i64, i1 } %res, 1 | |
| %res.1.ext = zext i1 %res.1 to i64 | |
| %add = add i64 %res.0, %res.1.ext | |
| ret i64 %add | |
| } |