1; RUN: llc -mtriple=x86_64-apple-macosx -o - %s | FileCheck %s 2 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. 6 7@var = global i32 0 8 9define 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 14 15 %stackint = ptrtoint i32* %stackvar to i64 16 %addr = add i64 ptrtoint(i32* @var to i64), %stackint 17 18 call void @eat_i64(i64 %addr) 19 ret void 20} 21 22declare void @eat_i64(i64) 23