[NFC][test] Refine tests for branch align
authorShengchen Kan <shengchen.kan@intel.com>
Sat, 11 Apr 2020 04:32:35 +0000 (12:32 +0800)
committerShengchen Kan <shengchen.kan@intel.com>
Sat, 11 Apr 2020 05:04:52 +0000 (13:04 +0800)
Remove some redundant blank and triple description. And rename some
files.

17 files changed:
llvm/test/MC/X86/align-branch-32bit.s [moved from llvm/test/MC/X86/align-branch-32-work.s with 51% similarity]
llvm/test/MC/X86/align-branch-align.s [moved from llvm/test/MC/X86/align-branch-64-align.s with 75% similarity]
llvm/test/MC/X86/align-branch-basic.s [moved from llvm/test/MC/X86/align-branch-64-basic.s with 92% similarity]
llvm/test/MC/X86/align-branch-bundle.s [moved from llvm/test/MC/X86/align-branch-64-bundle.s with 51% similarity]
llvm/test/MC/X86/align-branch-fused.s [moved from llvm/test/MC/X86/align-branch-64-fused.s with 82% similarity]
llvm/test/MC/X86/align-branch-general.s [moved from llvm/test/MC/X86/align-branch-64-general.s with 67% similarity]
llvm/test/MC/X86/align-branch-hardcode.s [moved from llvm/test/MC/X86/align-branch-64-hardcode.s with 74% similarity]
llvm/test/MC/X86/align-branch-mixed.s [moved from llvm/test/MC/X86/align-branch-64-mixed.s with 87% similarity]
llvm/test/MC/X86/align-branch-necessary.s [moved from llvm/test/MC/X86/align-branch-64-necessary.s with 78% similarity]
llvm/test/MC/X86/align-branch-negative.s [moved from llvm/test/MC/X86/align-branch-64-negative.s with 86% similarity]
llvm/test/MC/X86/align-branch-pad-max-prefix.s [moved from llvm/test/MC/X86/align-branch-64-pad-max-prefix.s with 70% similarity]
llvm/test/MC/X86/align-branch-prefix.s [moved from llvm/test/MC/X86/align-branch-64-prefix.s with 86% similarity]
llvm/test/MC/X86/align-branch-relax-all.s [moved from llvm/test/MC/X86/align-branch-64-relax-all.s with 61% similarity]
llvm/test/MC/X86/align-branch-section-size.s [moved from llvm/test/MC/X86/align-branch-64-section-size.s with 70% similarity]
llvm/test/MC/X86/align-branch-single.s [moved from llvm/test/MC/X86/align-branch-64-single.s with 64% similarity]
llvm/test/MC/X86/align-branch-system.s [moved from llvm/test/MC/X86/align-branch-64-system.s with 86% similarity]
llvm/test/MC/X86/align-branch-variant-symbol.s

similarity index 51%
rename from llvm/test/MC/X86/align-branch-32-work.s
rename to llvm/test/MC/X86/align-branch-32bit.s
index 44c13ef..1099e10 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jmp %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple i386 --x86-align-branch-boundary=32 --x86-align-branch=jmp %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Check the branch align mechanism can work in 32-bit mode.
 
similarity index 75%
rename from llvm/test/MC/X86/align-branch-64-align.s
rename to llvm/test/MC/X86/align-branch-align.s
index d5bed5b..14dd5dd 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Exercise some corner cases related to align directive.
 
similarity index 92%
rename from llvm/test/MC/X86/align-branch-64-basic.s
rename to llvm/test/MC/X86/align-branch-basic.s
index 7186b6b..a5a1d07 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=call+jmp+indirect+ret+jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=call+jmp+indirect+ret+jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # These tests are checking the basic cases for each instructions, and a
   # bit of the alignment checking logic itself.  Fused instruction cases are
similarity index 51%
rename from llvm/test/MC/X86/align-branch-64-bundle.s
rename to llvm/test/MC/X86/align-branch-bundle.s
index 54fd3c6..43dabca 100644 (file)
@@ -1,14 +1,13 @@
+# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=16 --x86-align-branch=fused+jcc --mc-relax-all %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+
 # Check using option --x86-align-branch-boundary=16 --x86-align-branch=fused+jcc --mc-relax-all with bundle won't make code crazy
-# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=16 --x86-align-branch=fused+jcc --mc-relax-all %s | llvm-objdump -d  - > %t1
-# RUN: FileCheck --input-file=%t1 %s
 
-# CHECK: 0000000000000000 <foo>:
-# CHECK-NEXT:       0: 55                               pushq    %rbp
-# CHECK-NEXT:       1: 48 f7 c2 02 00 00 00             testq    $2, %rdx
-# CHECK-NEXT:       8: 0f 85 f2 ff ff ff                jne      {{.*}}
-# CHECK-NEXT:       e: 90                               nop
-# CHECK-NEXT:       f: 90                               nop
-# CHECK-NEXT:      10: 0f 8e ea ff ff ff                jle      {{.*}}
+# CHECK:            0:       pushq    %rbp
+# CHECK-NEXT:       1:       testq    $2, %rdx
+# CHECK-NEXT:       8:       jne
+# CHECK-NEXT:       e:       nop
+# CHECK-NEXT:       f:       nop
+# CHECK-NEXT:      10:       jle
 
     .text
     .p2align 4
similarity index 82%
rename from llvm/test/MC/X86/align-branch-64-fused.s
rename to llvm/test/MC/X86/align-branch-fused.s
index 750afd7..7530967 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Exercise cases where fused instructions need to be aligned.
 
similarity index 67%
rename from llvm/test/MC/X86/align-branch-64-general.s
rename to llvm/test/MC/X86/align-branch-general.s
index f354cc7..ca29ab5 100644 (file)
@@ -1,6 +1,6 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+jmp %s -o %t1
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-branches-within-32B-boundaries %s -o %t2
-  # RUN: cmp %t1 %t2
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+jmp %s -o %t1
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-branches-within-32B-boundaries %s -o %t2
+# RUN: cmp %t1 %t2
 
   # Check the general option --x86-branches-within-32B-boundaries is equivelent
   # to the fined options --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+jmp.
similarity index 74%
rename from llvm/test/MC/X86/align-branch-64-hardcode.s
rename to llvm/test/MC/X86/align-branch-hardcode.s
index 103e905..1aa4125 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jmp+call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jmp+call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Exercise cases where instructions to be aligned is after hardcode
   # and thus can't add a nop in between without changing semantic.
similarity index 87%
rename from llvm/test/MC/X86/align-branch-64-mixed.s
rename to llvm/test/MC/X86/align-branch-mixed.s
index 2fa46fe..d5fd24c 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jcc+jmp+indirect+call+ret %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jcc+jmp+indirect+call+ret %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Exercise cases where mixed kinds of branch are asked to be aligned.
 
similarity index 78%
rename from llvm/test/MC/X86/align-branch-64-necessary.s
rename to llvm/test/MC/X86/align-branch-necessary.s
index 960bb92..8830ce0 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+indirect+call+ret %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc+indirect+call+ret %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Check if no instruction crosses or is against the boundary,
   # there will be no extra padding.
similarity index 86%
rename from llvm/test/MC/X86/align-branch-64-negative.s
rename to llvm/test/MC/X86/align-branch-negative.s
index 87c465c..598fe19 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=call+jmp+indirect+ret+jcc+fused %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=call+jmp+indirect+ret+jcc+fused %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # This file includes cases which are problematic to apply automatic padding
   # in the assembler.  These are the examples brought up in review and
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jmp -x86-pad-max-prefix-size=5 %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jmp -x86-pad-max-prefix-size=5 %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
   # Check instructions can be aligned correctly along with option -x86-pad-max-prefix-size=5
 
   .text
similarity index 86%
rename from llvm/test/MC/X86/align-branch-64-prefix.s
rename to llvm/test/MC/X86/align-branch-prefix.s
index 70efefe..c87e99c 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jmp+call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jmp+call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Exercise cases where prefixes are specified for instructions to be aligned
   # and thus can't add a nop in between without changing semantic.
similarity index 61%
rename from llvm/test/MC/X86/align-branch-64-relax-all.s
rename to llvm/test/MC/X86/align-branch-relax-all.s
index 672a90a..5dfbd80 100644 (file)
@@ -1,5 +1,5 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc --mc-relax-all %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc --x86-pad-max-prefix-size=5 --mc-relax-all %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc --mc-relax-all %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=fused+jcc --x86-pad-max-prefix-size=5 --mc-relax-all %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Check instructions can be aligned correctly along with option --mc-relax-all
 
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=ret %s | llvm-readobj -S | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=ret %s | llvm-readobj -S | FileCheck %s
 
   # Check the aligment of section that contains instructions to be aligned
   # is correctly set.
similarity index 64%
rename from llvm/test/MC/X86/align-branch-64-single.s
rename to llvm/test/MC/X86/align-branch-single.s
index 54ac2e4..eb6bb01 100644 (file)
@@ -1,8 +1,8 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=JCC 
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jmp %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=JMP
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=IND
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=CAL
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=ret %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=RET
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=JCC 
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jmp %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=JMP
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=IND
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=CAL
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=ret %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=RET
 
   # Exercise cases where only one kind of instruction is asked to be aligned.
   # Fused instruction cases are excluded.
similarity index 86%
rename from llvm/test/MC/X86/align-branch-64-system.s
rename to llvm/test/MC/X86/align-branch-system.s
index b62a4e3..c37b878 100644 (file)
@@ -1,4 +1,4 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=jmp %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jmp %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s
 
   # Exercise cases where we're enabling interrupts with one instruction delay
   # and thus can't add a nop in between without changing behavior.
index e1cb7b5..53afdf5 100644 (file)
@@ -1,6 +1,6 @@
-  # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=64BIT,CHECK
+# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=64BIT,CHECK
 
-  # RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=32BIT,CHECK
+# RUN: llvm-mc -filetype=obj -triple i386 --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=32BIT,CHECK
 
   # Exercise cases where the instruction to be aligned has a variant symbol
   # operand, and we can't add before it since linker may rewrite it.