1 ; RUN: llc -mtriple=x86_64-apple-macosx -o - %s | FileCheck %s
3 ; The issue here was a conflict between forming a %rip-relative lea and a
4 ; FrameIndex lea. The %rip sanity-checks didn't consider that a base register
5 ; had been set if we'd already matched a FrameIndex, when it has in reality.
9 define void @test_frame_rip_conflict() {
10 ; CHECK-LABEL: test_frame_rip_conflict:
11 ; CHECK: leaq _var(%rip), [[TMPADDR:%r.*]]
12 ; CHECK: leaq {{-?[0-9]+}}(%rsp,[[TMPADDR]]),
13 %stackvar = alloca i32
15 %stackint = ptrtoint ptr %stackvar to i64
16 %addr = add i64 ptrtoint(ptr @var to i64), %stackint
18 call void @eat_i64(i64 %addr)
22 declare void @eat_i64(i64)