Index: llvm/test/CodeGen/AArch64/xray-attribute-instrumentation.ll =================================================================== --- llvm/test/CodeGen/AArch64/xray-attribute-instrumentation.ll +++ llvm/test/CodeGen/AArch64/xray-attribute-instrumentation.ll @@ -1,4 +1,5 @@ -; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s -check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=aarch64-apple-darwin < %s | FileCheck %s -check-prefixes=CHECK,CHECK-MACOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK-LABEL: foo: @@ -26,11 +27,17 @@ ; CHECK-NEXT: ret } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0 -; CHECK: .xword .Lxray_sled_0 -; CHECK: .xword .Lxray_sled_1 -; CHECK-LABEL: Lxray_sleds_end0 +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: Lxray_sleds_start0: +; CHECK-LINUX: .xword .Lxray_sled_0 +; CHECK-LINUX: .xword .Lxray_sled_1 +; CHECK-LINUX-LABEL: Lxray_sleds_end0: + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS: .quad Lxray_sled_1 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: define i32 @bar() nounwind noinline uwtable "function-instrument"="xray-never" "function-instrument"="xray-always" { ; CHECK-LABEL: bar: @@ -58,11 +65,17 @@ ; CHECK-NEXT: ret } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start1 -; CHECK: .xword .Lxray_sled_2 -; CHECK: .xword .Lxray_sled_3 -; CHECK-LABEL: Lxray_sleds_end1 +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: Lxray_sleds_start1: +; CHECK-LINUX: .xword .Lxray_sled_2 +; CHECK-LINUX: .xword .Lxray_sled_3 +; CHECK-LINUX-LABEL: Lxray_sleds_end1: + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start1: +; CHECK-MACOS: .quad Lxray_sled_2 +; CHECK-MACOS: .quad Lxray_sled_3 +; CHECK-MACOS-LABEL: Lxray_sleds_end1: define i32 @instrumented() nounwind noinline uwtable "xray-instruction-threshold"="1" { ; CHECK-LABEL: instrumented: @@ -90,15 +103,21 @@ ; CHECK-NEXT: ret } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start2 -; CHECK: .xword .Lxray_sled_4 -; CHECK: .xword .Lxray_sled_5 -; CHECK-LABEL: Lxray_sleds_end2 +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: Lxray_sleds_start2: +; CHECK-LINUX: .xword .Lxray_sled_4 +; CHECK-LINUX: .xword .Lxray_sled_5 +; CHECK-LINUX-LABEL: Lxray_sleds_end2: + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start2: +; CHECK-MACOS: .quad Lxray_sled_4 +; CHECK-MACOS: .quad Lxray_sled_5 +; CHECK-MACOS-LABEL: Lxray_sleds_end2: define i32 @not_instrumented() nounwind noinline uwtable "xray-instruction-threshold"="1" "function-instrument"="xray-never" { ; CHECK-LABEL: not_instrumented -; CHECK-NOT: .Lxray_sled_6 +; CHECK-NOT: Lxray_sled_6 ret i32 0 ; CHECK: ret } Index: llvm/test/CodeGen/AArch64/xray-omit-function-index.ll =================================================================== --- llvm/test/CodeGen/AArch64/xray-omit-function-index.ll +++ llvm/test/CodeGen/AArch64/xray-omit-function-index.ll @@ -1,4 +1,5 @@ -; RUN: llc -no-xray-index -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s +; RUN: llc -no-xray-index -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -no-xray-index -mtriple=aarch64-apple-darwin < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK-LABEL: Lxray_sled_0: @@ -24,10 +25,16 @@ ; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: ret } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0 -; CHECK: .xword .Lxray_sled_0 -; CHECK: .xword .Lxray_sled_1 -; CHECK-LABEL: Lxray_sleds_end0 +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: Lxray_sleds_start0: +; CHECK-LINUX: .xword .Lxray_sled_0 +; CHECK-LINUX: .xword .Lxray_sled_1 +; CHECK-LINUX-LABEL: Lxray_sleds_end0: + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS: .quad Lxray_sled_1 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: ; CHECK-NOT: xray_fn_idx Index: llvm/test/CodeGen/AArch64/xray-partial-instrumentation-skip-entry.ll =================================================================== --- llvm/test/CodeGen/AArch64/xray-partial-instrumentation-skip-entry.ll +++ llvm/test/CodeGen/AArch64/xray-partial-instrumentation-skip-entry.ll @@ -1,4 +1,5 @@ -; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=aarch64-apple-darwin < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-entry" { ; CHECK-NOT: Lxray_sled_0: @@ -15,7 +16,13 @@ ; CHECK-LABEL: Ltmp0: ; CHECK-NEXT: ret } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0 -; CHECK: .xword .Lxray_sled_0 -; CHECK-LABEL: Lxray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: Lxray_sleds_start0: +; CHECK-LINUX: .xword .Lxray_sled_0 +; CHECK-LINUX-LABEL: Lxray_sleds_end0: + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: Index: llvm/test/CodeGen/AArch64/xray-partial-instrumentation-skip-exit.ll =================================================================== --- llvm/test/CodeGen/AArch64/xray-partial-instrumentation-skip-exit.ll +++ llvm/test/CodeGen/AArch64/xray-partial-instrumentation-skip-exit.ll @@ -1,4 +1,5 @@ -; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=aarch64-apple-darwin < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-exit" { ; CHECK-LABEL: Lxray_sled_0: @@ -15,7 +16,13 @@ ; CHECK-NOT: Lxray_sled_1: ; CHECK: ret } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0 -; CHECK: .xword .Lxray_sled_0 -; CHECK-LABEL: Lxray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: Lxray_sleds_start0: +; CHECK-LINUX: .xword .Lxray_sled_0 +; CHECK-LINUX-LABEL: Lxray_sleds_end0: + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: Index: llvm/test/CodeGen/AArch64/xray-tail-call-sled.ll =================================================================== --- llvm/test/CodeGen/AArch64/xray-tail-call-sled.ll +++ llvm/test/CodeGen/AArch64/xray-tail-call-sled.ll @@ -1,8 +1,9 @@ -; RUN: llc -mtriple=aarch64-linux-gnu < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=aarch64-apple-darwin < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define i32 @callee() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK: .p2align 2 -; CHECK-LABEL: .Lxray_sled_0: +; CHECK-LABEL: Lxray_sled_0: ; CHECK-NEXT: b #32 ; CHECK-NEXT: nop ; CHECK-NEXT: nop @@ -11,11 +12,11 @@ ; CHECK-NEXT: nop ; CHECK-NEXT: nop ; CHECK-NEXT: nop -; CHECK-LABEL: .Ltmp0: +; CHECK-LABEL: Ltmp0: ret i32 0 ; CHECK-NEXT: mov w0, wzr ; CHECK-NEXT: .p2align 2 -; CHECK-LABEL: .Lxray_sled_1: +; CHECK-LABEL: Lxray_sled_1: ; CHECK-NEXT: b #32 ; CHECK-NEXT: nop ; CHECK-NEXT: nop @@ -24,19 +25,31 @@ ; CHECK-NEXT: nop ; CHECK-NEXT: nop ; CHECK-NEXT: nop -; CHECK-LABEL: .Ltmp1: +; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: ret } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: .Lxray_sleds_start0: -; CHECK-NEXT: .Ltmp2: -; CHECK: .xword .Lxray_sled_0-.Ltmp2 -; CHECK: .Ltmp3: -; CHECK-NEXT: .xword .Lxray_sled_1-.Ltmp3 -; CHECK-LABEL: Lxray_sleds_end0: -; CHECK-LABEL: xray_fn_idx -; CHECK: .xword .Lxray_sleds_start0 -; CHECK-NEXT: .xword .Lxray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX-NEXT: .Ltmp2: +; CHECK-LINUX: .xword .Lxray_sled_0-.Ltmp2 +; CHECK-LINUX: .Ltmp3: +; CHECK-LINUX-NEXT: .xword .Lxray_sled_1-.Ltmp3 +; CHECK-LINUX-LABEL: Lxray_sleds_end0: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .xword .Lxray_sleds_start0 +; CHECK-LINUX-NEXT: .xword .Lxray_sleds_end0 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS-NEXT: Ltmp2: +; CHECK-MACOS: .quad Lxray_sled_0-Ltmp2 +; CHECK-MACOS: Ltmp3: +; CHECK-MACOS-NEXT: .quad Lxray_sled_1-Ltmp3 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start0 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end0 define i32 @caller() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK: .p2align 2 @@ -49,7 +62,7 @@ ; CHECK-NEXT: nop ; CHECK-NEXT: nop ; CHECK-NEXT: nop -; CHECK-LABEL: .Ltmp4: +; CHECK-LABEL: Ltmp4: ; CHECK: .p2align 2 ; CHECK-LABEL: Lxray_sled_3: ; CHECK-NEXT: b #32 @@ -60,16 +73,27 @@ ; CHECK-NEXT: nop ; CHECK-NEXT: nop ; CHECK-NEXT: nop -; CHECK-LABEL: .Ltmp5: +; CHECK-LABEL: Ltmp5: %retval = tail call i32 @callee() -; CHECK: b callee +; CHECK-LINUX: b callee +; CHECK-MACOS: b _callee ret i32 %retval } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start1: -; CHECK: .xword .Lxray_sled_2 -; CHECK: .xword .Lxray_sled_3 -; CHECK-LABEL: Lxray_sleds_end1: -; CHECK: .section xray_fn_idx,{{.*}} -; CHECK: .xword .Lxray_sleds_start1 -; CHECK-NEXT: .xword .Lxray_sleds_end1 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: Lxray_sleds_start1: +; CHECK-LINUX: .xword .Lxray_sled_2 +; CHECK-LINUX: .xword .Lxray_sled_3 +; CHECK-LINUX-LABEL: Lxray_sleds_end1: +; CHECK-LINUX-LABEL: .section xray_fn_idx,{{.*}} +; CHECK-LINUX: .xword .Lxray_sleds_start1 +; CHECK-LINUX-NEXT: .xword .Lxray_sleds_end1 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start1: +; CHECK-MACOS: .quad Lxray_sled_2 +; CHECK-MACOS: .quad Lxray_sled_3 +; CHECK-MACOS-LABEL: Lxray_sleds_end1: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start1 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end1 Index: llvm/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll =================================================================== --- llvm/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll +++ llvm/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple=armv6-unknown-linux-gnu < %s | FileCheck %s -; RUN: llc -mtriple=armv6-apple-ios6.0.0 < %s | FileCheck %s +; RUN: llc -mtriple=armv6-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=armv6-apple-ios6.0.0 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-IOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK-LABEL: Lxray_sled_0: @@ -23,11 +23,21 @@ ; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: bx lr } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0: -; CHECK: .long {{.*}}Lxray_sled_0 -; CHECK: .long {{.*}}Lxray_sled_1 -; CHECK-LABEL: Lxray_sleds_end0: -; CHECK-LABEL: xray_fn_idx -; CHECK: .long {{.*}}Lxray_sleds_start0 -; CHECK-NEXT: .long {{.*}}Lxray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX: .long .Lxray_sled_0 +; CHECK-LINUX: .long .Lxray_sled_1 +; CHECK-LINUX-LABEL: .Lxray_sleds_end0: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .long .Lxray_sleds_start0 +; CHECK-LINUX-NEXT: .long .Lxray_sleds_end0 + +; CHECK-IOS-LABEL: .section __DATA,xray_instr_map +; CHECK-IOS-LABEL: Lxray_sleds_start0: +; CHECK-IOS: .long Lxray_sled_0 +; CHECK-IOS: .long Lxray_sled_1 +; CHECK-IOS-LABEL: Lxray_sleds_end0: +; CHECK-IOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-IOS: .long Lxray_sleds_start0 +; CHECK-IOS-NEXT: .long Lxray_sleds_end0 Index: llvm/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll =================================================================== --- llvm/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll +++ llvm/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple=armv7-unknown-linux-gnu < %s | FileCheck %s -; RUN: llc -mtriple=armv7-apple-ios6.0.0 < %s | FileCheck %s +; RUN: llc -mtriple=armv7-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=armv7-apple-ios6.0.0 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-IOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK-LABEL: Lxray_sled_0: @@ -23,12 +23,21 @@ ; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: bx lr } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0: -; CHECK: .long {{.*}}Lxray_sled_0 -; CHECK: .long {{.*}}Lxray_sled_1 -; CHECK-LABEL: Lxray_sleds_end0: -; CHECK-LABEL: xray_fn_idx -; CHECK: .long {{.*}}xray_sleds_start0 -; CHECK-NEXT: .long {{.*}}xray_sleds_end0 +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX: .long .Lxray_sled_0 +; CHECK-LINUX: .long .Lxray_sled_1 +; CHECK-LINUX-LABEL: .Lxray_sleds_end0: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .long .Lxray_sleds_start0 +; CHECK-LINUX-NEXT: .long .Lxray_sleds_end0 + +; CHECK-IOS-LABEL: .section __DATA,xray_instr_map +; CHECK-IOS-LABEL: Lxray_sleds_start0: +; CHECK-IOS: .long Lxray_sled_0 +; CHECK-IOS: .long Lxray_sled_1 +; CHECK-IOS-LABEL: Lxray_sleds_end0: +; CHECK-IOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-IOS: .long Lxray_sleds_start0 +; CHECK-IOS-NEXT: .long Lxray_sleds_end0 Index: llvm/test/CodeGen/X86/xray-attribute-instrumentation.ll =================================================================== --- llvm/test/CodeGen/X86/xray-attribute-instrumentation.ll +++ llvm/test/CodeGen/X86/xray-attribute-instrumentation.ll @@ -1,6 +1,6 @@ -; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s -; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s -; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s +; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK: .p2align 1, 0x90 @@ -13,14 +13,24 @@ ; CHECK: retq ; CHECK-NEXT: nopw %cs:512(%rax,%rax) } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0: -; CHECK: .quad {{.*}}xray_sled_0 -; CHECK: .quad {{.*}}xray_sled_1 -; CHECK-LABEL: Lxray_sleds_end0: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start0 -; CHECK-NEXT: .quad {{.*}}xray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX: .quad .Lxray_sled_0 +; CHECK-LINUX: .quad .Lxray_sled_1 +; CHECK-LINUX-LABEL: .Lxray_sleds_end0: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start0 +; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end0 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS: .quad Lxray_sled_1 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start0 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end0 ; We test multiple returns in a single function to make sure we're getting all @@ -46,15 +56,29 @@ ; CHECK: retq ; CHECK-NEXT: nopw %cs:512(%rax,%rax) } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start1: -; CHECK: Ltmp2: -; CHECK-NEXT: .quad {{.*}}xray_sled_2-{{\.?}}Ltmp2 -; CHECK: Ltmp3: -; CHECK-NEXT: .quad {{.*}}xray_sled_3-{{\.?}}Ltmp3 -; CHECK: Ltmp4: -; CHECK-NEXT: .quad {{.*}}xray_sled_4-{{\.?}}Ltmp4 -; CHECK-LABEL: Lxray_sleds_end1: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start1 -; CHECK-NEXT: .quad {{.*}}xray_sleds_end1 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start1: +; CHECK-LINUX: .Ltmp2: +; CHECK-LINUX-NEXT: .quad .Lxray_sled_2-.Ltmp2 +; CHECK-LINUX: .Ltmp3: +; CHECK-LINUX-NEXT: .quad .Lxray_sled_3-.Ltmp3 +; CHECK-LINUX: .Ltmp4: +; CHECK-LINUX-NEXT: .quad .Lxray_sled_4-.Ltmp4 +; CHECK-LINUX-LABEL: .Lxray_sleds_end1: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start1 +; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end1 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start1: +; CHECK-MACOS: Ltmp2: +; CHECK-MACOS-NEXT: .quad Lxray_sled_2-Ltmp2 +; CHECK-MACOS: Ltmp3: +; CHECK-MACOS-NEXT: .quad Lxray_sled_3-Ltmp3 +; CHECK-MACOS: Ltmp4: +; CHECK-MACOS-NEXT: .quad Lxray_sled_4-Ltmp4 +; CHECK-MACOS-LABEL: Lxray_sleds_end1: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start1 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end1 Index: llvm/test/CodeGen/X86/xray-log-args.ll =================================================================== --- llvm/test/CodeGen/X86/xray-log-args.ll +++ llvm/test/CodeGen/X86/xray-log-args.ll @@ -1,7 +1,7 @@ ; When logging arguments is specified, emit the entry sled accordingly. -; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s -; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s +; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define i32 @callee(i32 %arg) nounwind noinline uwtable "function-instrument"="xray-always" "xray-log-args"="1" { ret i32 %arg @@ -9,38 +9,71 @@ ; CHECK-LABEL: callee: ; CHECK-NEXT: Lfunc_begin0: -; CHECK-LABEL: Lxray_sleds_start0: -; CHECK-NEXT: Ltmp0: -; CHECK-NEXT: .quad {{\.?}}Lxray_sled_0-{{\.?}}Ltmp0 -; CHECK-NEXT: .quad {{\.?}}Lfunc_begin0-({{\.?}}Ltmp0+8) -; CHECK-NEXT: .byte 0x03 -; CHECK-NEXT: .byte 0x01 -; CHECK-NEXT: .byte 0x02 -; CHECK: .{{(zero|space)}} 13 -; CHECK: Ltmp1: -; CHECK-NEXT: .quad {{\.?}}Lxray_sled_1-{{\.?}}Ltmp1 -; CHECK-NEXT: .quad {{\.?}}Lfunc_begin0-({{\.?}}Ltmp1+8) -; CHECK-NEXT: .byte 0x01 -; CHECK-NEXT: .byte 0x01 -; CHECK-NEXT: .byte 0x02 -; CHECK: .{{(zero|space)}} 13 +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX-NEXT: .Ltmp0: +; CHECK-LINUX-NEXT: .quad .Lxray_sled_0-.Ltmp0 +; CHECK-LINUX-NEXT: .quad .Lfunc_begin0-(.Ltmp0+8) +; CHECK-LINUX-NEXT: .byte 0x03 +; CHECK-LINUX-NEXT: .byte 0x01 +; CHECK-LINUX-NEXT: .byte 0x02 +; CHECK-LINUX: .zero 13 +; CHECK-LINUX: .Ltmp1: +; CHECK-LINUX-NEXT: .quad .Lxray_sled_1-.Ltmp1 +; CHECK-LINUX-NEXT: .quad .Lfunc_begin0-(.Ltmp1+8) +; CHECK-LINUX-NEXT: .byte 0x01 +; CHECK-LINUX-NEXT: .byte 0x01 +; CHECK-LINUX-NEXT: .byte 0x02 +; CHECK-LINUX: .zero 13 + +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS-NEXT: Ltmp0: +; CHECK-MACOS-NEXT: .quad Lxray_sled_0-Ltmp0 +; CHECK-MACOS-NEXT: .quad Lfunc_begin0-(Ltmp0+8) +; CHECK-MACOS-NEXT: .byte 0x03 +; CHECK-MACOS-NEXT: .byte 0x01 +; CHECK-MACOS-NEXT: .byte 0x02 +; CHECK-MACOS: .space 13 +; CHECK-MACOS: Ltmp1: +; CHECK-MACOS-NEXT: .quad Lxray_sled_1-Ltmp1 +; CHECK-MACOS-NEXT: .quad Lfunc_begin0-(Ltmp1+8) +; CHECK-MACOS-NEXT: .byte 0x01 +; CHECK-MACOS-NEXT: .byte 0x01 +; CHECK-MACOS-NEXT: .byte 0x02 +; CHECK-MACOS: .space 13 define i32 @caller(i32 %arg) nounwind noinline uwtable "function-instrument"="xray-always" "xray-log-args"="1" { %retval = tail call i32 @callee(i32 %arg) ret i32 %retval } -; CHECK-LABEL: Lxray_sleds_start1: -; CHECK-NEXT: Ltmp3: -; CHECK-NEXT: .quad {{\.?}}Lxray_sled_2-{{\.?}}Ltmp3 -; CHECK-NEXT: .quad {{\.?}}Lfunc_begin1-({{\.?}}Ltmp3+8) -; CHECK-NEXT: .byte 0x03 -; CHECK-NEXT: .byte 0x01 -; CHECK-NEXT: .byte 0x02 -; CHECK: .{{(zero|space)}} 13 -; CHECK: Ltmp4: -; CHECK-NEXT: .quad {{\.?}}Lxray_sled_3-{{\.?}}Ltmp4 -; CHECK-NEXT: .quad {{\.?}}Lfunc_begin1-({{\.?}}Ltmp4+8) -; CHECK-NEXT: .byte 0x02 -; CHECK-NEXT: .byte 0x01 -; CHECK-NEXT: .byte 0x02 -; CHECK: .{{(zero|space)}} 13 + +; CHECK-LINUX-LABEL: .Lxray_sleds_start1: +; CHECK-LINUX-NEXT: .Ltmp3: +; CHECK-LINUX-NEXT: .quad .Lxray_sled_2-.Ltmp3 +; CHECK-LINUX-NEXT: .quad .Lfunc_begin1-(.Ltmp3+8) +; CHECK-LINUX-NEXT: .byte 0x03 +; CHECK-LINUX-NEXT: .byte 0x01 +; CHECK-LINUX-NEXT: .byte 0x02 +; CHECK-LINUX: .zero 13 +; CHECK-LINUX: .Ltmp4: +; CHECK-LINUX-NEXT: .quad .Lxray_sled_3-.Ltmp4 +; CHECK-LINUX-NEXT: .quad .Lfunc_begin1-(.Ltmp4+8) +; CHECK-LINUX-NEXT: .byte 0x02 +; CHECK-LINUX-NEXT: .byte 0x01 +; CHECK-LINUX-NEXT: .byte 0x02 +; CHECK-LINUX: .zero 13 + +; CHECK-MACOS-LABEL: Lxray_sleds_start1: +; CHECK-MACOS-NEXT: Ltmp3: +; CHECK-MACOS-NEXT: .quad Lxray_sled_2-Ltmp3 +; CHECK-MACOS-NEXT: .quad Lfunc_begin1-(Ltmp3+8) +; CHECK-MACOS-NEXT: .byte 0x03 +; CHECK-MACOS-NEXT: .byte 0x01 +; CHECK-MACOS-NEXT: .byte 0x02 +; CHECK-MACOS: .space 13 +; CHECK-MACOS: Ltmp4: +; CHECK-MACOS-NEXT: .quad Lxray_sled_3-Ltmp4 +; CHECK-MACOS-NEXT: .quad Lfunc_begin1-(Ltmp4+8) +; CHECK-MACOS-NEXT: .byte 0x02 +; CHECK-MACOS-NEXT: .byte 0x01 +; CHECK-MACOS-NEXT: .byte 0x02 +; CHECK-MACOS: .space 13 Index: llvm/test/CodeGen/X86/xray-partial-instrumentation-skip-entry.ll =================================================================== --- llvm/test/CodeGen/X86/xray-partial-instrumentation-skip-entry.ll +++ llvm/test/CodeGen/X86/xray-partial-instrumentation-skip-entry.ll @@ -1,6 +1,6 @@ -; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s -; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s -; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s +; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -relocation-model=pic < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" "xray-skip-entry" { ; CHECK-NOT: Lxray_sled_0: @@ -10,13 +10,22 @@ ; CHECK: retq ; CHECK-NEXT: nopw %cs:512(%rax,%rax) } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0: -; CHECK: .quad {{.*}}xray_sled_0 -; CHECK-LABEL: Lxray_sleds_end0: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start0 -; CHECK-NEXT: .quad {{.*}}xray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX: .quad .Lxray_sled_0 +; CHECK-LINUX-LABEL: .Lxray_sleds_end0: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start0 +; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end0 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start0 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end0 ; We test multiple returns in a single function to make sure we're getting all @@ -39,11 +48,21 @@ ; CHECK: retq ; CHECK-NEXT: nopw %cs:512(%rax,%rax) } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start1: -; CHECK: .quad {{.*}}xray_sled_1 -; CHECK: .quad {{.*}}xray_sled_2 -; CHECK-LABEL: Lxray_sleds_end1: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start1 -; CHECK-NEXT: .quad {{.*}}xray_sleds_end1 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start1: +; CHECK-LINUX: .quad .Lxray_sled_1 +; CHECK-LINUX: .quad .Lxray_sled_2 +; CHECK-LINUX-LABEL: .Lxray_sleds_end1: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start1 +; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end1 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start1: +; CHECK-MACOS: .quad Lxray_sled_1 +; CHECK-MACOS: .quad Lxray_sled_2 +; CHECK-MACOS-LABEL: Lxray_sleds_end1: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start1 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end1 Index: llvm/test/CodeGen/X86/xray-partial-instrumentation-skip-exit.ll =================================================================== --- llvm/test/CodeGen/X86/xray-partial-instrumentation-skip-exit.ll +++ llvm/test/CodeGen/X86/xray-partial-instrumentation-skip-exit.ll @@ -12,13 +12,22 @@ ; CHECK-NOT: Lxray_sled_1: ; CHECK: retq } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0: -; CHECK: .quad {{.*}}xray_sled_0 -; CHECK-LABEL: Lxray_sleds_end0: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start0 -; CHECK-NEXT: .quad {{.*}}xray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX: .quad .Lxray_sled_0 +; CHECK-LINUX-LABEL: .Lxray_sleds_end0: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start0 +; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end0 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start0 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end0 ; We test multiple returns in a single function to make sure we're skipping all @@ -40,10 +49,19 @@ ; CHECK-NOT: Lxray_sled_{{.*}}: ; CHECK: retq } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start1: -; CHECK: .quad {{.*}}xray_sled_1 -; CHECK-LABEL: Lxray_sleds_end1: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start1 -; CHECK-NEXT: .quad {{.*}}xray_sleds_end1 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start1: +; CHECK-LINUX: .quad .Lxray_sled_1 +; CHECK-LINUX-LABEL: .Lxray_sleds_end1: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start1 +; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end1 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start1: +; CHECK-MACOS: .quad Lxray_sled_1 +; CHECK-MACOS-LABEL: Lxray_sleds_end1: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start1 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end1 Index: llvm/test/CodeGen/X86/xray-tail-call-sled.ll =================================================================== --- llvm/test/CodeGen/X86/xray-tail-call-sled.ll +++ llvm/test/CodeGen/X86/xray-tail-call-sled.ll @@ -1,5 +1,5 @@ -; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s -; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s +; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s --check-prefixes=CHECK,CHECK-LINUX +; RUN: llc -mtriple=x86_64-darwin-unknown < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MACOS define dso_local i32 @callee() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK: .p2align 1, 0x90 @@ -12,14 +12,24 @@ ; CHECK: retq ; CHECK-NEXT: nopw %cs:512(%rax,%rax) } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start0: -; CHECK: .quad {{.*}}xray_sled_0 -; CHECK: .quad {{.*}}xray_sled_1 -; CHECK-LABEL: Lxray_sleds_end0: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start0 -; CHECK-NEXT: .quad {{.*}}xray_sleds_end0 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start0: +; CHECK-LINUX: .quad .Lxray_sled_0 +; CHECK-LINUX: .quad .Lxray_sled_1 +; CHECK-LINUX-LABEL: .Lxray_sleds_end0: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start0 +; CHECK-LINUX-NEXT: .quad .Lxray_sleds_end0 + +; CHECK-MACOS-LABEL: .section __DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start0: +; CHECK-MACOS: .quad Lxray_sled_0 +; CHECK-MACOS: .quad Lxray_sled_1 +; CHECK-MACOS-LABEL: Lxray_sleds_end0: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start0 +; CHECK-MACOS-NEXT: .quad Lxray_sleds_end0 define dso_local i32 @caller() nounwind noinline uwtable "function-instrument"="xray-always" { ; CHECK: .p2align 1, 0x90 @@ -34,11 +44,21 @@ ; CHECK: jmp {{.*}}callee {{.*}}# TAILCALL ret i32 %retval } -; CHECK-LABEL: xray_instr_map -; CHECK-LABEL: Lxray_sleds_start1: -; CHECK: .quad {{.*}}xray_sled_2 -; CHECK: .quad {{.*}}xray_sled_3 -; CHECK-LABEL: Lxray_sleds_end1: -; CHECK-LABEL: xray_fn_idx -; CHECK: .quad {{.*}}xray_sleds_start1 -; CHECK: .quad {{.*}}xray_sleds_end1 + +; CHECK-LINUX-LABEL: .section xray_instr_map +; CHECK-LINUX-LABEL: .Lxray_sleds_start1: +; CHECK-LINUX: .quad .Lxray_sled_2 +; CHECK-LINUX: .quad .Lxray_sled_3 +; CHECK-LINUX-LABEL: .Lxray_sleds_end1: +; CHECK-LINUX-LABEL: .section xray_fn_idx +; CHECK-LINUX: .quad .Lxray_sleds_start1 +; CHECK-LINUX: .quad .Lxray_sleds_end1 + +; CHECK-MACOS-LABEL: .section _DATA,xray_instr_map +; CHECK-MACOS-LABEL: Lxray_sleds_start1: +; CHECK-MACOS: .quad Lxray_sled_2 +; CHECK-MACOS: .quad Lxray_sled_3 +; CHECK-MACOS-LABEL: Lxray_sleds_end1: +; CHECK-MACOS-LABEL: .section __DATA,xray_fn_idx +; CHECK-MACOS: .quad Lxray_sleds_start1 +; CHECK-MACOS: .quad Lxray_sleds_end1