23 lines · plain
1; RUN: llc -mtriple=x86_64-apple-macosx -o - %s | FileCheck %s2 3; The issue here was a conflict between forming a %rip-relative lea and a4; FrameIndex lea. The %rip sanity-checks didn't consider that a base register5; had been set if we'd already matched a FrameIndex, when it has in reality.6 7@var = global i32 08 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 i3214 15 %stackint = ptrtoint ptr %stackvar to i6416 %addr = add i64 ptrtoint(ptr @var to i64), %stackint17 18 call void @eat_i64(i64 %addr)19 ret void20}21 22declare void @eat_i64(i64)23