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/win32-pic-jumptable.ll
Reid Kleckner bfd9be426f [MC] Suppress .Lcfi labels when emitting textual assembly
Summary:
This suppresses the generation of .Lcfi labels in our textual assembler.
It was annoying that this generated cascading .Lcfi labels:
  llc foo.ll -o - | llvm-mc | llvm-mc

After three trips through MCAsmStreamer, we'd have three labels in the
output when none are necessary. We should only bother creating the
labels and frame data when making a real object file.

This supercedes D38605, which moved the entire .seh_ implementation into
MCObjectStreamer.

This has the advantage that we do more checking when emitting textual
assembly, as a minor efficiency cost. Outputting textual assembly is not
performance critical, so this shouldn't matter.

Reviewers: majnemer, MatzeB

Subscribers: qcolombet, nemanjai, javed.absar, eraman, hiraditya, JDevlieghere, llvm-commits

Differential Revision: https://reviews.llvm.org/D38638

llvm-svn: 315259
2017-10-10 00:57:36 +00:00

39 lines
819 B
LLVM

; RUN: llc < %s -relocation-model=pic | FileCheck %s
; CHECK: calll L0$pb
; CHECK-NEXT: .cfi_adjust_cfa_offset 4
; CHECK-NEXT: L0$pb:
; CHECK-NEXT: popl %eax
; CHECK-NEXT: .cfi_adjust_cfa_offset -4
; CHECK-NEXT: addl LJTI0_0(,%ecx,4), %eax
; CHECK-NEXT: jmpl *%eax
; CHECK: LJTI0_0:
; CHECK-NEXT: .long LBB0_2-L0$pb
; CHECK-NEXT: .long LBB0_3-L0$pb
; CHECK-NEXT: .long LBB0_4-L0$pb
; CHECK-NEXT: .long LBB0_5-L0$pb
target triple = "i686--windows-itanium"
define i32 @f(i64 %x) {
bb0:
switch i64 %x, label %bb5 [
i64 1, label %bb1
i64 2, label %bb2
i64 3, label %bb3
i64 4, label %bb4
]
bb1:
br label %bb5
bb2:
br label %bb5
bb3:
br label %bb5
bb4:
br label %bb5
bb5:
%y = phi i32 [ 0, %bb0 ], [ 1, %bb1 ], [ 2, %bb2 ], [ 3, %bb3 ], [ 4, %bb4 ]
ret i32 %y
}