aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-09-24 23:06:27 +0000
committerJim Grosbach <grosbach@apple.com>2012-09-24 23:06:27 +0000
commite9525d862454674ce87a9da52b2d05915a142206 (patch)
treea3324f3d4e697b95463fb60b9b1d623d25fef016 /test/CodeGen
parent7f8f3f7f6400291d30531c88a98511f9fc626b4c (diff)
downloadexternal_llvm-e9525d862454674ce87a9da52b2d05915a142206.zip
external_llvm-e9525d862454674ce87a9da52b2d05915a142206.tar.gz
external_llvm-e9525d862454674ce87a9da52b2d05915a142206.tar.bz2
Mark jump tables in code sections with DataRegion directives.
Even out-of-line jump tables can be in the code section, so mark them as data-regions for those targets which support the directives. rdar://12362871&12362974 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/pic_jumptable.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/X86/pic_jumptable.ll b/test/CodeGen/X86/pic_jumptable.ll
index 8c16dc6..bdd8859 100644
--- a/test/CodeGen/X86/pic_jumptable.ll
+++ b/test/CodeGen/X86/pic_jumptable.ll
@@ -1,5 +1,7 @@
; RUN: llc < %s -relocation-model=pic -mtriple=i386-linux-gnu -asm-verbose=false \
; RUN: | FileCheck %s --check-prefix=CHECK-LINUX
+; RUN: llc < %s -relocation-model=pic -mark-data-regions -mtriple=i686-apple-darwin -asm-verbose=false \
+; RUN: | FileCheck %s --check-prefix=CHECK-DATA
; RUN: llc < %s -relocation-model=pic -mtriple=i686-apple-darwin -asm-verbose=false \
; RUN: | FileCheck %s
; RUN: llc < %s -mtriple=x86_64-apple-darwin | not grep 'lJTI'
@@ -16,6 +18,16 @@ entry:
; CHECK: Ltmp0 = LJTI0_0-L0$pb
; CHECK-NEXT: addl Ltmp0(%eax,%ecx,4)
; CHECK-NEXT: jmpl *%eax
+
+;; When data-in-code markers are enabled, we should see them around the jump
+;; table.
+; CHECK-DATA: .data_region jt32
+; CHECK-DATA: LJTI0_0
+; CHECK-DATA: .end_data_region
+
+;; When they're not enabled, make sure we don't see them at all.
+; CHECK-NOT: .data_region
+; CHECK-LINUX-NOT: .data_region
%Y_addr = alloca i32 ; <i32*> [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
store i32 %Y, i32* %Y_addr