brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 371851f Raw
51 lines · plain
1# This test is to validate instrumentation code sequence generated with2# and without `--no-lse-atomics`.3 4# REQUIRES: system-linux,bolt-runtime,target=aarch64{{.*}}5 6# RUN: %clang %cflags -pie %s -o %t.so -Wl,-q -Wl,--init=_foo -Wl,--fini=_foo7 8  .text9  .global _foo10  .type _foo, %function11_foo:12  ret13 14  .global _start15  .type _start, %function16_start:17  ret18 19  # Dummy relocation to force relocation mode20  .reloc 0, R_AARCH64_NONE21 22# RUN: llvm-bolt %t.so -o %t.instr.so --instrument23# RUN: llvm-objdump -d %t.instr.so | FileCheck %s --check-prefix=INLINE24# INLINE: {{.*}} <_foo>:25# INLINE-NEXT: {{.*}} stp x0, x1, [sp, #-0x10]!26# INLINE-NEXT: {{.*}} adrp  x0, 0x{{[0-9a-f]*}} {{.*}}27# INLINE-NEXT: {{.*}} add x0, x0, #0x{{[0-9a-f]*}}28# INLINE-NEXT: {{.*}} mov x1, #0x1 29# INLINE-NEXT: {{.*}} stadd x1, [x0]30# INLINE-NEXT: {{.*}} ldp x0, x1, [sp], #0x1031 32# RUN: llvm-bolt %t.so -o %t.instr.no_lse.so --instrument \33# RUN:   --no-lse-atomics34# RUN: llvm-objdump -d %t.instr.no_lse.so | FileCheck %s --check-prefix=NOLSE35# NOLSE: {{.*}} <_foo>:36# NOLSE-NEXT: {{.*}} stp x0, x30, [sp, #-0x10]!37# NOLSE-NEXT: {{.*}} stp x1, x2, [sp, #-0x10]!38# NOLSE-NEXT: {{.*}} adrp x0, 0x{{[0-9a-f]*}} {{.*}}39# NOLSE-NEXT: {{.*}} add x0, x0, #0x{{[0-9a-f]*}}40# NOLSE-NEXT: {{.*}} adrp x1, 0x[[PAGEBASE:[0-9a-f]*]]000 {{.*}}41# NOLSE-NEXT: {{.*}} add x1, x1, #0x[[PAGEOFF:[0-9a-f]*]]42# NOLSE-NEXT: {{.*}} blr x143# NOLSE-NEXT: {{.*}} ldp x0, x30, [sp], #0x1044# NOLSE: {{[0]*}}[[PAGEBASE]][[PAGEOFF]] <__bolt_instr_counter_incr>:45# NOLSE-NEXT: {{.*}} ldaxr x1, [x0]46# NOLSE-NEXT: {{.*}} add x1, x1, #0x147# NOLSE-NEXT: {{.*}} stlxr w2, x1, [x0]48# NOLSE-NEXT: {{.*}} cbnz w2, 0x{{[0-9[a-f]*}} <__bolt_instr_counter_incr>49# NOLSE-NEXT: {{.*}} ldp x1, x2, [sp], #0x1050# NOLSE-NEXT: {{.*}} ret51