[llvm] e028cee - MC: Ensure test only reads from the Inputs directory
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 23 11:09:05 PST 2019
Author: David Blaikie
Date: 2019-12-23T11:08:26-08:00
New Revision: e028cee66a23da568ba62c6323c6a29f4c7f63ae
URL: https://github.com/llvm/llvm-project/commit/e028cee66a23da568ba62c6323c6a29f4c7f63ae
DIFF: https://github.com/llvm/llvm-project/commit/e028cee66a23da568ba62c6323c6a29f4c7f63ae.diff
LOG: MC: Ensure test only reads from the Inputs directory
Added:
llvm/test/MC/X86/Inputs/align-branch-64-1.s
llvm/test/MC/X86/Inputs/align-branch-64-2.s
Modified:
llvm/test/MC/X86/align-branch-64-1a.s
llvm/test/MC/X86/align-branch-64-1b.s
llvm/test/MC/X86/align-branch-64-1c.s
llvm/test/MC/X86/align-branch-64-1d.s
llvm/test/MC/X86/align-branch-64-2a.s
llvm/test/MC/X86/align-branch-64-2b.s
llvm/test/MC/X86/align-branch-64-2c.s
Removed:
################################################################################
diff --git a/llvm/test/MC/X86/Inputs/align-branch-64-1.s b/llvm/test/MC/X86/Inputs/align-branch-64-1.s
new file mode 100644
index 000000000000..e5ca17621d03
--- /dev/null
+++ b/llvm/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/llvm/test/MC/X86/Inputs/align-branch-64-2.s b/llvm/test/MC/X86/Inputs/align-branch-64-2.s
new file mode 100644
index 000000000000..16b854da71e2
--- /dev/null
+++ b/llvm/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/llvm/test/MC/X86/align-branch-64-1a.s b/llvm/test/MC/X86/align-branch-64-1a.s
index c2187f9e73aa..75381568d227 100644
--- a/llvm/test/MC/X86/align-branch-64-1a.s
+++ b/llvm/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/llvm/test/MC/X86/align-branch-64-1b.s b/llvm/test/MC/X86/align-branch-64-1b.s
index 3647e4e85be3..994b6c04deff 100644
--- a/llvm/test/MC/X86/align-branch-64-1b.s
+++ b/llvm/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/llvm/test/MC/X86/align-branch-64-1c.s b/llvm/test/MC/X86/align-branch-64-1c.s
index 11e0f2be0064..5f9301101755 100644
--- a/llvm/test/MC/X86/align-branch-64-1c.s
+++ b/llvm/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/llvm/test/MC/X86/align-branch-64-1d.s b/llvm/test/MC/X86/align-branch-64-1d.s
index be6b5cf94719..d39aeb1b9890 100644
--- a/llvm/test/MC/X86/align-branch-64-1d.s
+++ b/llvm/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/llvm/test/MC/X86/align-branch-64-2a.s b/llvm/test/MC/X86/align-branch-64-2a.s
index fe38f71c0692..61e9e1f899b9 100644
--- a/llvm/test/MC/X86/align-branch-64-2a.s
+++ b/llvm/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/llvm/test/MC/X86/align-branch-64-2b.s b/llvm/test/MC/X86/align-branch-64-2b.s
index c7ffa16922f2..1cb49f7d1090 100644
--- a/llvm/test/MC/X86/align-branch-64-2b.s
+++ b/llvm/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/llvm/test/MC/X86/align-branch-64-2c.s b/llvm/test/MC/X86/align-branch-64-2c.s
index 71b84e587d8a..bb750aa24a07 100644
--- a/llvm/test/MC/X86/align-branch-64-2c.s
+++ b/llvm/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
More information about the llvm-commits
mailing list