mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
MC: Ensure test only reads from the Inputs directory
This commit is contained in:
parent
1fd3c2cbc2
commit
3a680fc7a9
43
test/MC/X86/Inputs/align-branch-64-1.s
Normal file
43
test/MC/X86/Inputs/align-branch-64-1.s
Normal file
@ -0,0 +1,43 @@
|
||||
.text
|
||||
.globl foo
|
||||
.p2align 4
|
||||
foo:
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
cmp %rax, %rbp
|
||||
xorl %eax, %eax
|
||||
cmp %rax, %rbp
|
||||
je .L_2
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
xorl %eax, %eax
|
||||
je .L_2
|
||||
popq %rbp
|
||||
je .L_2
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
xorl %eax, %eax
|
||||
jmp .L_3
|
||||
jmp .L_3
|
||||
jmp .L_3
|
||||
.rept 2
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
movl %eax, -4(%rbp)
|
||||
popq %rbp
|
||||
cmp %rax, %rbp
|
||||
je .L_2
|
||||
jmp .L_3
|
||||
.L_2:
|
||||
movl -12(%rbp), %eax
|
||||
movl %eax, -4(%rbp)
|
||||
.L_3:
|
||||
.rept 10
|
||||
movl %esi, -1200(%rbp)
|
||||
.endr
|
||||
jmp .L_3
|
||||
retq
|
||||
|
27
test/MC/X86/Inputs/align-branch-64-2.s
Normal file
27
test/MC/X86/Inputs/align-branch-64-2.s
Normal file
@ -0,0 +1,27 @@
|
||||
.text
|
||||
.globl foo
|
||||
.p2align 4
|
||||
foo:
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
.rept 2
|
||||
movl %esi, -12(%rbp)
|
||||
.endr
|
||||
jmp *%rax
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
movl %esi, -12(%rbp)
|
||||
pushq %rbp
|
||||
call *%rax
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
pushq %rbp
|
||||
call foo
|
||||
.rept 4
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
call *foo
|
||||
|
@ -1,10 +1,10 @@
|
||||
# Check only fused conditional jumps, conditional jumps and unconditional jumps are aligned with option --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+jmp
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+jmp %s | llvm-objdump -d - > %t1
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+jmp %p/Inputs/align-branch-64-1.s | llvm-objdump -d - > %t1
|
||||
# RUN: FileCheck --input-file=%t1 %s
|
||||
|
||||
# Check no branches is aligned with option --x86-align-branch-boundary=0
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=0 --x86-align-branch=fused+jcc+jmp %s | llvm-objdump -d - > %t2
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s | llvm-objdump -d - > %t3
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=0 --x86-align-branch=fused+jcc+jmp %p/Inputs/align-branch-64-1.s | llvm-objdump -d - > %t2
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %p/Inputs/align-branch-64-1.s | llvm-objdump -d - > %t3
|
||||
# RUN: cmp %t2 %t3
|
||||
|
||||
# CHECK: 0000000000000000 foo:
|
||||
@ -38,46 +38,3 @@
|
||||
# CHECK-COUNT-10: : 89 b5 50 fb ff ff movl %esi, -1200(%rbp)
|
||||
# CHECK: c4: eb c2 jmp {{.*}}
|
||||
# CHECK-NEXT: c6: c3 retq
|
||||
|
||||
.text
|
||||
.globl foo
|
||||
.p2align 4
|
||||
foo:
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
cmp %rax, %rbp
|
||||
xorl %eax, %eax
|
||||
cmp %rax, %rbp
|
||||
je .L_2
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
xorl %eax, %eax
|
||||
je .L_2
|
||||
popq %rbp
|
||||
je .L_2
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
xorl %eax, %eax
|
||||
jmp .L_3
|
||||
jmp .L_3
|
||||
jmp .L_3
|
||||
.rept 2
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
movl %eax, -4(%rbp)
|
||||
popq %rbp
|
||||
cmp %rax, %rbp
|
||||
je .L_2
|
||||
jmp .L_3
|
||||
.L_2:
|
||||
movl -12(%rbp), %eax
|
||||
movl %eax, -4(%rbp)
|
||||
.L_3:
|
||||
.rept 10
|
||||
movl %esi, -1200(%rbp)
|
||||
.endr
|
||||
jmp .L_3
|
||||
retq
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Check only fused conditional jumps and conditional jumps are aligned with option --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc %S/align-branch-64-1a.s | llvm-objdump -d - | FileCheck %s
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc %p/Inputs/align-branch-64-1.s | llvm-objdump -d - | FileCheck %s
|
||||
|
||||
# CHECK: 0000000000000000 foo:
|
||||
# CHECK-COUNT-3: : 64 89 04 25 01 00 00 00 movl %eax, %fs:1
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Check only conditional jumps are aligned with option --x86-align-branch-boundary=32 --x86-align-branch=jcc
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=jcc %S/align-branch-64-1a.s | llvm-objdump -d - | FileCheck %s
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=jcc %p/Inputs/align-branch-64-1.s | llvm-objdump -d - | FileCheck %s
|
||||
|
||||
# CHECK: 0000000000000000 foo:
|
||||
# CHECK-COUNT-3: : 64 89 04 25 01 00 00 00 movl %eax, %fs:1
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Check only conditional jumps and unconditional jumps are aligned with option --x86-align-branch-boundary=32 --x86-align-branch=jcc+jmp
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=jcc+jmp %S/align-branch-64-1a.s | llvm-objdump -d - > %t1
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=jcc+jmp %p/Inputs/align-branch-64-1.s | llvm-objdump -d - > %t1
|
||||
# RUN: FileCheck --input-file=%t1 %s --check-prefixes=CHECK,SHORT-NOP
|
||||
|
||||
# Check long NOP can be emitted to align branch if the target cpu support long nop.
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 -mcpu=x86-64 --x86-align-branch=jcc+jmp %S/align-branch-64-1a.s | llvm-objdump -d - >%t2
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 -mcpu=x86-64 --x86-align-branch=jcc+jmp %p/Inputs/align-branch-64-1.s | llvm-objdump -d - >%t2
|
||||
# RUN: FileCheck --input-file=%t2 %s --check-prefixes=CHECK,LONG-NOP
|
||||
|
||||
# CHECK: 0000000000000000 foo:
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Check only indirect jumps are aligned with option --x86-align-branch-boundary=32 --x86-align-branch=indirect
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=indirect %s | llvm-objdump -d - | FileCheck %s
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=indirect %p/Inputs/align-branch-64-2.s | llvm-objdump -d - | FileCheck %s
|
||||
|
||||
# CHECK: 0000000000000000 foo:
|
||||
# CHECK-COUNT-3: : 64 89 04 25 01 00 00 00 movl %eax, %fs:1
|
||||
@ -15,30 +15,3 @@
|
||||
# CHECK-NEXT: 59: e8 a2 ff ff ff callq {{.*}}
|
||||
# CHECK-COUNT-4: : 64 89 04 25 01 00 00 00 movl %eax, %fs:1
|
||||
# CHECK: 7e: ff 14 25 00 00 00 00 callq *0
|
||||
|
||||
.text
|
||||
.globl foo
|
||||
.p2align 4
|
||||
foo:
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
.rept 2
|
||||
movl %esi, -12(%rbp)
|
||||
.endr
|
||||
jmp *%rax
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
movl %esi, -12(%rbp)
|
||||
pushq %rbp
|
||||
call *%rax
|
||||
.rept 3
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
pushq %rbp
|
||||
call foo
|
||||
.rept 4
|
||||
movl %eax, %fs:0x1
|
||||
.endr
|
||||
call *foo
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Check only calls are aligned with option --x86-align-branch-boundary=32 --x86-align-branch=call
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=call %S/align-branch-64-2a.s| llvm-objdump -d - | FileCheck %s
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=call %p/Inputs/align-branch-64-2.s | llvm-objdump -d - | FileCheck %s
|
||||
|
||||
# CHECK: 0000000000000000 foo:
|
||||
# CHECK-COUNT-3: : 64 89 04 25 01 00 00 00 movl %eax, %fs:1
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Check only indirect jumps and calls are aligned with option --x86-align-branch-boundary=32 --x86-align-branch=indirect+call
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=indirect+call %S/align-branch-64-2a.s | llvm-objdump -d - | FileCheck %s
|
||||
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=32 --x86-align-branch=indirect+call %p/Inputs/align-branch-64-2.s | llvm-objdump -d - | FileCheck %s
|
||||
|
||||
# CHECK: 0000000000000000 foo:
|
||||
# CHECK-COUNT-3: : 64 89 04 25 01 00 00 00 movl %eax, %fs:1
|
||||
|
Loading…
Reference in New Issue
Block a user