1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
llvm-mirror/test/CodeGen/X86/large-pic-string.ll
Reid Kleckner 3deb981a62 [ELF] Fix large code model MIR verifier errors
Instead of using the MOVGOT64r pseudo, use the existing
MO_PIC_BASE_OFFSET support on symbol operands. Now I don't have to
create a "scratch register operand" for the pseudo to use, and the
register allocator can make better decisions.

Fixes some X86 verifier errors tracked in PR27481.

llvm-svn: 345219
2018-10-24 22:57:28 +00:00

22 lines
742 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs < %s -code-model=large -relocation-model=pic -mtriple=x86_64--linux | FileCheck %s
@.str = private unnamed_addr constant [2 x i8] c"a\00", align 1
define void @pr38385() {
; CHECK-LABEL: pr38385:
; CHECK: # %bb.0:
; CHECK-NEXT: .L0$pb:
; CHECK-NEXT: leaq .L0${{.*}}(%rip), %rax
; CHECK-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.L0$pb, %rcx
; CHECK-NEXT: addq %rax, %rcx
; CHECK-NEXT: movabsq $.L.str@GOTOFF, %rax
; CHECK-NEXT: addl %eax, %ecx
; CHECK-NEXT: movb %cl, -{{[0-9]+}}(%rsp)
; CHECK-NEXT: retq
%p = alloca i8, align 1
store i8 ptrtoint ([2 x i8]* @.str to i8), i8* %p, align 1
ret void
}