Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -relocation-model static | FileCheck %s
      2 
      3 ; FIXME: Remove '-relocation-model static' when it is no longer necessary to
      4 ; trigger the separate .rdata section.
      5 
      6 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
      7 target triple = "x86_64-pc-windows-msvc19.0.24215"
      8 
      9 define void @f(i32 %x) {
     10 entry:
     11   switch i32 %x, label %sw.epilog [
     12     i32 0, label %sw.bb
     13     i32 1, label %sw.bb1
     14     i32 2, label %sw.bb2
     15     i32 3, label %sw.bb3
     16   ]
     17 
     18 sw.bb:                                            ; preds = %entry
     19   tail call void @g(i32 0) #2
     20   br label %sw.epilog
     21 
     22 sw.bb1:                                           ; preds = %entry
     23   tail call void @g(i32 1) #2
     24   br label %sw.epilog
     25 
     26 sw.bb2:                                           ; preds = %entry
     27   tail call void @g(i32 2) #2
     28   br label %sw.epilog
     29 
     30 sw.bb3:                                           ; preds = %entry
     31   tail call void @g(i32 3) #2
     32   br label %sw.epilog
     33 
     34 sw.epilog:                                        ; preds = %entry, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb
     35   tail call void @g(i32 10) #2
     36   ret void
     37 }
     38 
     39 declare void @g(i32)
     40 
     41 ; CHECK: .text
     42 ; CHECK: f:
     43 ; CHECK: .seh_proc f
     44 ; CHECK: jmpq    *.LJTI0_0
     45 ; CHECK: .LBB0_{{.*}}: # %sw.bb
     46 ; CHECK: .LBB0_{{.*}}: # %sw.bb1
     47 ; CHECK: .LBB0_{{.*}}: # %sw.bb2
     48 ; CHECK: .LBB0_{{.*}}: # %sw.bb3
     49 ; CHECK: callq g
     50 ; CHECK: jmp g # TAILCALL
     51 ; CHECK: .section        .rdata,"dr"
     52 ; CHECK: .quad .LBB0_
     53 ; CHECK: .quad .LBB0_
     54 ; CHECK: .quad .LBB0_
     55 ; CHECK: .quad .LBB0_
     56 ; CHECK: .seh_handlerdata
     57 
     58 ; It's important that we switch back to .text here, not .rdata.
     59 ; CHECK: .text
     60 ; CHECK: .seh_endproc
     61