File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,8 @@ unsigned X86TargetLowering::getJumpTableEncoding() const {
417
417
if (isPositionIndependent () && Subtarget.isPICStyleGOT ())
418
418
return MachineJumpTableInfo::EK_Custom32;
419
419
if (isPositionIndependent () &&
420
- getTargetMachine ().getCodeModel () == CodeModel::Large)
420
+ getTargetMachine ().getCodeModel () == CodeModel::Large &&
421
+ !Subtarget.isTargetCOFF ())
421
422
return MachineJumpTableInfo::EK_LabelDifference64;
422
423
423
424
// Otherwise, use the normal jump table encoding heuristics.
Original file line number Diff line number Diff line change 1
- ; RUN: llc < %s -relocation-model static | FileCheck %s
1
+ ; RUN: llc < %s -relocation-model=static | FileCheck %s
2
+ ; RUN: llc < %s -relocation-model=pic | FileCheck %s --check-prefix=PIC
3
+ ; RUN: llc < %s -relocation-model=pic -code-model=large | FileCheck %s --check-prefix=PIC
2
4
3
- ; FIXME: Remove '-relocation-model static' when it is no longer necessary to
5
+ ; FIXME: Remove '-relocation-model= static' when it is no longer necessary to
4
6
; trigger the separate .rdata section.
5
7
6
8
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
@@ -57,3 +59,9 @@ declare void @g(i32)
57
59
; It's important that we switch back to .text here, not .rdata.
58
60
; CHECK: .text
59
61
; CHECK: .seh_endproc
62
+
63
+ ; Windows PIC code should use 32-bit entries
64
+ ; PIC: .long .LBB0_2-.LJTI0_0
65
+ ; PIC: .long .LBB0_3-.LJTI0_0
66
+ ; PIC: .long .LBB0_4-.LJTI0_0
67
+ ; PIC: .long .LBB0_5-.LJTI0_0
You can’t perform that action at this time.
0 commit comments