From aa3d4d9939595295d19969c62077cc09e4823f58 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Fri, 15 Jan 2021 08:50:59 -0800 Subject: [PATCH] [NFC] Disallow unused prefixes under MC/RISCV Differential Revision: https://reviews.llvm.org/D94836 --- llvm/test/MC/RISCV/lit.local.cfg | 8 ++++++++ llvm/test/MC/RISCV/rv32c-only-valid.s | 10 +++++----- llvm/test/MC/RISCV/rv32zfh-valid.s | 4 ++-- llvm/test/MC/RISCV/rv64zfh-valid.s | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/llvm/test/MC/RISCV/lit.local.cfg b/llvm/test/MC/RISCV/lit.local.cfg index c63820126f8c..896e7941295e 100644 --- a/llvm/test/MC/RISCV/lit.local.cfg +++ b/llvm/test/MC/RISCV/lit.local.cfg @@ -1,2 +1,10 @@ +from lit.llvm.subst import ToolSubst + if not 'RISCV' in config.root.targets: config.unsupported = True + +fc = ToolSubst('FileCheck', unresolved='fatal') +# Insert this first. Then, we'll first update the blank FileCheck command; then, +# the default substitution of FileCheck will replace it to its full path. +config.substitutions.insert(0, (fc.regex, + 'FileCheck --allow-unused-prefixes=false')) diff --git a/llvm/test/MC/RISCV/rv32c-only-valid.s b/llvm/test/MC/RISCV/rv32c-only-valid.s index edd5a656eeae..0b10b3f0e90e 100644 --- a/llvm/test/MC/RISCV/rv32c-only-valid.s +++ b/llvm/test/MC/RISCV/rv32c-only-valid.s @@ -1,18 +1,18 @@ # RUN: llvm-mc %s -triple=riscv32 -mattr=+c -riscv-no-aliases -show-encoding \ -# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s +# RUN: | FileCheck --check-prefix=CHECK-ASM %s # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+c < %s \ # RUN: | llvm-objdump --mattr=+c -M no-aliases -d -r - \ -# RUN: | FileCheck --check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s +# RUN: | FileCheck --check-prefix=CHECK-OBJ %s # # RUN: not llvm-mc -triple riscv32 \ # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \ -# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT %s +# RUN: | FileCheck --check-prefix=CHECK-NO-EXT %s # RUN: not llvm-mc -triple riscv64 -mattr=+c \ # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \ -# RUN: | FileCheck -check-prefixes=CHECK-NO-RV32 %s +# RUN: | FileCheck --check-prefix=CHECK-NO-RV32 %s # RUN: not llvm-mc -triple riscv64 \ # RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \ -# RUN: | FileCheck -check-prefixes=CHECK-NO-RV32-AND-EXT %s +# RUN: | FileCheck --check-prefix=CHECK-NO-RV32-AND-EXT %s # CHECK-OBJ: c.jal 0x7fe # CHECK-ASM: c.jal 2046 diff --git a/llvm/test/MC/RISCV/rv32zfh-valid.s b/llvm/test/MC/RISCV/rv32zfh-valid.s index a6853fb95ea0..f257ad0d91fe 100644 --- a/llvm/test/MC/RISCV/rv32zfh-valid.s +++ b/llvm/test/MC/RISCV/rv32zfh-valid.s @@ -4,10 +4,10 @@ # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zfh < %s \ # RUN: | llvm-objdump --mattr=+experimental-zfh -M no-aliases -d -r - \ -# RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zfh < %s \ # RUN: | llvm-objdump --mattr=+experimental-zfh -M no-aliases -d -r - \ -# RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s # CHECK-ASM-AND-OBJ: flh ft0, 12(a0) # CHECK-ASM: encoding: [0x07,0x10,0xc5,0x00] diff --git a/llvm/test/MC/RISCV/rv64zfh-valid.s b/llvm/test/MC/RISCV/rv64zfh-valid.s index 0a667f668d4f..49aa4e7aaaef 100644 --- a/llvm/test/MC/RISCV/rv64zfh-valid.s +++ b/llvm/test/MC/RISCV/rv64zfh-valid.s @@ -2,7 +2,7 @@ # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zfh < %s \ # RUN: | llvm-objdump --mattr=+experimental-zfh -M no-aliases -d -r - \ -# RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s # # RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zfh < %s 2>&1 \ # RUN: | FileCheck -check-prefix=CHECK-RV32 %s