Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64][ARM][X86] Split XRay tests for Linux/macOS
XRay instrumentation works for macOS running on Apple Silicon, but codegen is untested there. I'm going to make changes affecting this target, get the XRay tests running on AArch64. Data sections are going to become slightly different on x86_64 soon. I do want the tests to be specific about symbol names, so instead of having test check the common step, bifurcate tests a bit and check the full symbol names. As for ARM, XRay is not really supported on iOS at the moment, though ARM is also really used there with modern phones. Nevertheless, codegen tests exist and the output is going to change a little, make it easier to write the special case for iOS. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D145291
- Loading branch information
Showing
12 changed files
with
430 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,99 @@ | ||
; RUN: llc -mtriple=aarch64-linux-gnu < %s | FileCheck %s | ||
|
||
define i32 @callee() nounwind noinline uwtable "function-instrument"="xray-always" { | ||
; CHECK: .p2align 2 | ||
; CHECK-LABEL: .Lxray_sled_0: | ||
; CHECK-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-LABEL: .Ltmp0: | ||
ret i32 0 | ||
; CHECK-NEXT: mov w0, wzr | ||
; CHECK-NEXT: .p2align 2 | ||
; CHECK-LABEL: .Lxray_sled_1: | ||
; CHECK-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; 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 | ||
|
||
define i32 @caller() nounwind noinline uwtable "function-instrument"="xray-always" { | ||
; CHECK: .p2align 2 | ||
; CHECK-LABEL: Lxray_sled_2: | ||
; CHECK-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-LABEL: .Ltmp4: | ||
; CHECK: .p2align 2 | ||
; CHECK-LABEL: Lxray_sled_3: | ||
; CHECK-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-LABEL: .Ltmp5: | ||
%retval = tail call i32 @callee() | ||
; CHECK: 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 | ||
; 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-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-LABEL: Ltmp0: | ||
ret i32 0 | ||
; CHECK-NEXT: mov w0, wzr | ||
; CHECK-NEXT: .p2align 2 | ||
; CHECK-LABEL: Lxray_sled_1: | ||
; CHECK-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-LABEL: Ltmp1: | ||
; CHECK-NEXT: ret | ||
} | ||
|
||
; CHECK-LINUX-LABEL: .section xray_instr_map,"ao",@progbits,callee{{$}} | ||
; 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,"awo",@progbits,callee{{$}} | ||
; 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 | ||
; CHECK-LABEL: Lxray_sled_2: | ||
; CHECK-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-LABEL: Ltmp4: | ||
; CHECK: .p2align 2 | ||
; CHECK-LABEL: Lxray_sled_3: | ||
; CHECK-NEXT: b #32 | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-NEXT: nop | ||
; CHECK-LABEL: Ltmp5: | ||
%retval = tail call i32 @callee() | ||
; CHECK-LINUX: b callee | ||
; CHECK-MACOS: b _callee | ||
ret i32 %retval | ||
} | ||
|
||
; CHECK-LINUX-LABEL: .section xray_instr_map,"ao",@progbits,caller{{$}} | ||
; 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,"awo",@progbits,caller{{$}} | ||
; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.