summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/implicit-null-check.ll20
-rw-r--r--llvm/test/MC/X86/faultmap-section-parsing.s29
2 files changed, 49 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/implicit-null-check.ll b/llvm/test/CodeGen/X86/implicit-null-check.ll
index f4c539800fb..defd48a781a 100644
--- a/llvm/test/CodeGen/X86/implicit-null-check.ll
+++ b/llvm/test/CodeGen/X86/implicit-null-check.ll
@@ -1,5 +1,15 @@
; RUN: llc -O3 -mtriple=x86_64-apple-macosx -enable-implicit-null-checks < %s | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-apple-macosx -enable-implicit-null-checks \
+; RUN: | llvm-mc -triple x86_64-apple-macosx -filetype=obj -o - \
+; RUN: | llvm-objdump -triple x86_64-apple-macosx -fault-map-section - \
+; RUN: | FileCheck %s -check-prefix OBJDUMP
+
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -enable-implicit-null-checks \
+; RUN: | llvm-mc -triple x86_64-unknown-linux-gnu -filetype=obj -o - \
+; RUN: | llvm-objdump -triple x86_64-unknown-linux-gnu -fault-map-section - \
+; RUN: | FileCheck %s -check-prefix OBJDUMP
+
define i32 @imp_null_check_load(i32* %x) {
; CHECK-LABEL: _imp_null_check_load:
; CHECK: Ltmp1:
@@ -116,3 +126,13 @@ define i32 @imp_null_check_add_result(i32* %x, i32 %p) {
; CHECK-NEXT: .long Ltmp1-_imp_null_check_load
; Fault[0].HandlerOffset:
; CHECK-NEXT: .long Ltmp0-_imp_null_check_load
+
+; OBJDUMP: FaultMap table:
+; OBJDUMP-NEXT: Version: 0x1
+; OBJDUMP-NEXT: NumFunctions: 3
+; OBJDUMP-NEXT: FunctionAddress: 0x000000, NumFaultingPCs: 1
+; OBJDUMP-NEXT: Fault kind: FaultingLoad, faulting PC offset: 0, handling PC offset: 5
+; OBJDUMP-NEXT: FunctionAddress: 0x000000, NumFaultingPCs: 1
+; OBJDUMP-NEXT: Fault kind: FaultingLoad, faulting PC offset: 0, handling PC offset: 7
+; OBJDUMP-NEXT: FunctionAddress: 0x000000, NumFaultingPCs: 1
+; OBJDUMP-NEXT: Fault kind: FaultingLoad, faulting PC offset: 0, handling PC offset: 3
diff --git a/llvm/test/MC/X86/faultmap-section-parsing.s b/llvm/test/MC/X86/faultmap-section-parsing.s
new file mode 100644
index 00000000000..758e70fe685
--- /dev/null
+++ b/llvm/test/MC/X86/faultmap-section-parsing.s
@@ -0,0 +1,29 @@
+// RUN: llvm-mc < %s -triple=x86_64-apple-macosx -filetype=obj -o - | llvm-objdump -fault-map-section - | FileCheck %s
+
+ .section __LLVM_FAULTMAPS,__llvm_faultmaps
+__LLVM_FaultMaps:
+ .byte 1
+ .byte 0
+ .short 0
+ .long 2
+ .quad 0xFFDEAD
+ .long 1
+ .long 0
+ .long 1
+ .long 100
+ .long 200
+
+ .quad 0xFFDAED
+ .long 1
+ .long 0
+ .long 1
+ .long 400
+ .long 500
+
+// CHECK: FaultMap table:
+// CHECK-NEXT: Version: 0x1
+// CHECK-NEXT: NumFunctions: 2
+// CHECK-NEXT: FunctionAddress: 0xffdead, NumFaultingPCs: 1
+// CHECK-NEXT: Fault kind: FaultingLoad, faulting PC offset: 100, handling PC offset: 200
+// CHECK-NEXT: FunctionAddress: 0xffdaed, NumFaultingPCs: 1
+// CHECK-NEXT: Fault kind: FaultingLoad, faulting PC offset: 400, handling PC offset: 500
OpenPOWER on IntegriCloud