From 3a680fc7a9eee41529deedad05d56d2914f047f2 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 23 Dec 2019 11:08:26 -0800 Subject: [PATCH] MC: Ensure test only reads from the Inputs directory --- test/MC/X86/Inputs/align-branch-64-1.s | 43 ++++++++++++++++++++++ test/MC/X86/Inputs/align-branch-64-2.s | 27 ++++++++++++++ test/MC/X86/align-branch-64-1a.s | 49 ++------------------------ test/MC/X86/align-branch-64-1b.s | 2 +- test/MC/X86/align-branch-64-1c.s | 2 +- test/MC/X86/align-branch-64-1d.s | 4 +-- test/MC/X86/align-branch-64-2a.s | 29 +-------------- test/MC/X86/align-branch-64-2b.s | 2 +- test/MC/X86/align-branch-64-2c.s | 2 +- 9 files changed, 80 insertions(+), 80 deletions(-) create mode 100644 test/MC/X86/Inputs/align-branch-64-1.s create mode 100644 test/MC/X86/Inputs/align-branch-64-2.s diff --git a/test/MC/X86/Inputs/align-branch-64-1.s b/test/MC/X86/Inputs/align-branch-64-1.s new file mode 100644 index 00000000000..e5ca17621d0 --- /dev/null +++ b/test/MC/X86/Inputs/align-branch-64-1.s @@ -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 + diff --git a/test/MC/X86/Inputs/align-branch-64-2.s b/test/MC/X86/Inputs/align-branch-64-2.s new file mode 100644 index 00000000000..16b854da71e --- /dev/null +++ b/test/MC/X86/Inputs/align-branch-64-2.s @@ -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 + diff --git a/test/MC/X86/align-branch-64-1a.s b/test/MC/X86/align-branch-64-1a.s index c2187f9e73a..75381568d22 100644 --- a/test/MC/X86/align-branch-64-1a.s +++ b/test/MC/X86/align-branch-64-1a.s @@ -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 diff --git a/test/MC/X86/align-branch-64-1b.s b/test/MC/X86/align-branch-64-1b.s index 3647e4e85be..994b6c04def 100644 --- a/test/MC/X86/align-branch-64-1b.s +++ b/test/MC/X86/align-branch-64-1b.s @@ -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 diff --git a/test/MC/X86/align-branch-64-1c.s b/test/MC/X86/align-branch-64-1c.s index 11e0f2be006..5f930110175 100644 --- a/test/MC/X86/align-branch-64-1c.s +++ b/test/MC/X86/align-branch-64-1c.s @@ -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 diff --git a/test/MC/X86/align-branch-64-1d.s b/test/MC/X86/align-branch-64-1d.s index be6b5cf9471..d39aeb1b989 100644 --- a/test/MC/X86/align-branch-64-1d.s +++ b/test/MC/X86/align-branch-64-1d.s @@ -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: diff --git a/test/MC/X86/align-branch-64-2a.s b/test/MC/X86/align-branch-64-2a.s index fe38f71c069..61e9e1f899b 100644 --- a/test/MC/X86/align-branch-64-2a.s +++ b/test/MC/X86/align-branch-64-2a.s @@ -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 diff --git a/test/MC/X86/align-branch-64-2b.s b/test/MC/X86/align-branch-64-2b.s index c7ffa16922f..1cb49f7d109 100644 --- a/test/MC/X86/align-branch-64-2b.s +++ b/test/MC/X86/align-branch-64-2b.s @@ -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 diff --git a/test/MC/X86/align-branch-64-2c.s b/test/MC/X86/align-branch-64-2c.s index 71b84e587d8..bb750aa24a0 100644 --- a/test/MC/X86/align-branch-64-2c.s +++ b/test/MC/X86/align-branch-64-2c.s @@ -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