Files
clang-p2996/llvm/test/CodeGen/X86/large-pic-string.ll
Reid Kleckner 15e91c3235 [X86] Fix assertion in subreg extraction
This assert fires when attempting to extract a subregister from the
global PIC base register. This virtual register SD node is not in the
VRBaseMap, so we shouldn't call getVR to look it up there. If this is a
RegisterSDNode, we should be able to use the virtual register directly.

Fixes PR38385

llvm-svn: 339056
2018-08-06 21:16:16 +00:00

22 lines
716 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %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: .Ltmp0:
; CHECK-NEXT: leaq {{.*}}(%rip), %rax
; CHECK-NEXT: movabsq $_GLOBAL_OFFSET_TABLE_-.Ltmp0, %rcx
; CHECK-NEXT: addq %rcx, %rax
; CHECK-NEXT: movabsq $.L.str@GOTOFF, %rcx
; CHECK-NEXT: addl %ecx, %eax
; CHECK-NEXT: movb %al, -{{[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
}