brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 17ef0d3 Raw
68 lines · plain
1; RUN: llc < %s -relocation-model=static | FileCheck %s2; RUN: llc < %s -relocation-model=pic | FileCheck %s --check-prefix=PIC3; RUN: llc < %s -relocation-model=pic -code-model=large | FileCheck %s --check-prefix=PIC4 5; FIXME: Remove '-relocation-model=static' when it is no longer necessary to6; trigger the separate .rdata section.7 8target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"9target triple = "x86_64-pc-windows-msvc19.0.24215"10 11define void @f(i32 %x) {12entry:13  switch i32 %x, label %sw.epilog [14    i32 0, label %sw.bb15    i32 1, label %sw.bb116    i32 2, label %sw.bb217    i32 3, label %sw.bb318  ]19 20sw.bb:                                            ; preds = %entry21  tail call void @g(i32 0) #222  br label %sw.epilog23 24sw.bb1:                                           ; preds = %entry25  tail call void @g(i32 1) #226  br label %sw.epilog27 28sw.bb2:                                           ; preds = %entry29  tail call void @g(i32 2) #230  br label %sw.epilog31 32sw.bb3:                                           ; preds = %entry33  tail call void @g(i32 3) #234  br label %sw.epilog35 36sw.epilog:                                        ; preds = %entry, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb37  tail call void @g(i32 10) #238  ret void39}40 41declare void @g(i32)42 43; CHECK: .text44; CHECK: f:45; CHECK: .seh_proc f46; CHECK: jmpq    *.LJTI0_047; CHECK: .LBB0_{{.*}}: # %sw.bb48; CHECK: .LBB0_{{.*}}: # %sw.bb249; CHECK: .LBB0_{{.*}}: # %sw.bb350; CHECK: .LBB0_{{.*}}: # %sw.bb151; CHECK: callq g52; CHECK: jmp g # TAILCALL53; CHECK: .section        .rdata,"dr"54; CHECK: .quad .LBB0_55; CHECK: .quad .LBB0_56; CHECK: .quad .LBB0_57; CHECK: .quad .LBB0_58 59; It's important that we switch back to .text here, not .rdata.60; CHECK: .text61; CHECK: .seh_endproc62 63; Windows PIC code should use 32-bit entries64; PIC: .long .LBB0_2-.LJTI0_065; PIC: .long .LBB0_3-.LJTI0_066; PIC: .long .LBB0_4-.LJTI0_067; PIC: .long .LBB0_5-.LJTI0_068