[PATCH] D95417: [NFC] Disallow unused prefixes under clang/test/CodeGen
mtrofin created this revision. mtrofin added a reviewer: MaskRay. mtrofin requested review of this revision. Herald added a reviewer: jdoerfert. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D95417 Files: clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp clang/test/CodeGen/catch-alignment-assumption-openmp.cpp clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec.c clang/test/CodeGen/catch-implicit-integer-sign-changes-true-negatives.c clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec.c clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c clang/test/CodeGen/catch-nullptr-and-nonzero-offset-when-nullptr-is-defined.c clang/test/CodeGen/catch-nullptr-and-nonzero-offset.c clang/test/CodeGen/catch-pointer-overflow-volatile.c clang/test/CodeGen/catch-pointer-overflow.c clang/test/CodeGen/cmse-clear-return.c clang/test/CodeGen/lit.local.cfg Index: clang/test/CodeGen/lit.local.cfg === --- /dev/null +++ clang/test/CodeGen/lit.local.cfg @@ -0,0 +1,9 @@ +# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79: +from lit.llvm.subst import ToolSubst + +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')) + Index: clang/test/CodeGen/cmse-clear-return.c === --- clang/test/CodeGen/cmse-clear-return.c +++ clang/test/CodeGen/cmse-clear-return.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple thumbv8m.main -O0 -mcmse -S -emit-llvm %s -o - | \ // RUN:FileCheck %s --check-prefixes=CHECK,CHECK-LE,CHECK-LE-NOPT,CHECK-SOFT // RUN: %clang_cc1 -triple thumbebv8m.main -O0 -mcmse -S -emit-llvm %s -o - | \ -// RUN:FileCheck %s --check-prefixes=CHECK,CHECK-BE,CHECK-BE-NOPT,CHECK-SOFT +// RUN:FileCheck %s --check-prefixes=CHECK,CHECK-BE,CHECK-SOFT // RUN: %clang_cc1 -triple thumbv8m.main -O2 -mcmse -S -emit-llvm %s -o - | \ // RUN:FileCheck %s --check-prefixes=CHECK,CHECK-LE,CHECK-LE-OPT,CHECK-SOFT // RUN: %clang_cc1 -triple thumbebv8m.main -O2 -mcmse -S -emit-llvm %s -o - | \ Index: clang/test/CodeGen/catch-pointer-overflow.c === --- clang/test/CodeGen/catch-pointer-overflow.c +++ clang/test/CodeGen/catch-pointer-overflow.c @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE +// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s // RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE // RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER // RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE -// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE +// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s // RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE // RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fsanitize-recov
[PATCH] D95417: [NFC] Disallow unused prefixes under clang/test/CodeGen
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. Thanks! Comment at: clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp:2 +// RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s // RUN: %clang_cc1 -fsanitize=alignment -fno-sanitize-recover=alignment -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_alignment_assumption" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE // RUN: %clang_cc1 -fsanitize=alignment -fsanitize-recover=alignment -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_alignment_assumption" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER Not: these tests can be generalized a bit: `-triple x86_64-linux-gnu` -> `-triple x86_64` (because they work for generic ELF and are not tied to Linux), but there is probably no reason to cause that churn since it has been committed. Comment at: clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp:3 // RUN: %clang_cc1 -fsanitize=alignment -fno-sanitize-recover=alignment -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_alignment_assumption" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE // RUN: %clang_cc1 -fsanitize=alignment -fsanitize-recover=alignment -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_alignment_assumption" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER // RUN: %clang_cc1 -fsanitize=alignment -fsanitize-trap=alignment -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_alignment_assumption" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE If the intention of `CHECK-NOSANITIZE` is to explicitly check there is no sanitizer variable, it should use some `-NOT:` patterns. However, sanitizer variables should be obvious so that can be omitted. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95417/new/ https://reviews.llvm.org/D95417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D95417: [NFC] Disallow unused prefixes under clang/test/CodeGen
This revision was automatically updated to reflect the committed changes. Closed by commit rG0c0d009a88f2: [NFC] Disallow unused prefixes under clang/test/CodeGen (authored by mtrofin). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95417/new/ https://reviews.llvm.org/D95417 Files: clang/test/CodeGen/catch-alignment-assumption-attribute-align_value-on-lvalue.cpp clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params-variable.cpp clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-three-params.cpp clang/test/CodeGen/catch-alignment-assumption-builtin_assume_aligned-two-params.cpp clang/test/CodeGen/catch-alignment-assumption-openmp.cpp clang/test/CodeGen/catch-implicit-integer-sign-changes-incdec.c clang/test/CodeGen/catch-implicit-integer-sign-changes-true-negatives.c clang/test/CodeGen/catch-implicit-signed-integer-truncations-incdec.c clang/test/CodeGen/catch-nullptr-and-nonzero-offset-blacklist.c clang/test/CodeGen/catch-nullptr-and-nonzero-offset-when-nullptr-is-defined.c clang/test/CodeGen/catch-nullptr-and-nonzero-offset.c clang/test/CodeGen/catch-pointer-overflow-volatile.c clang/test/CodeGen/catch-pointer-overflow.c clang/test/CodeGen/cmse-clear-return.c clang/test/CodeGen/lit.local.cfg Index: clang/test/CodeGen/lit.local.cfg === --- /dev/null +++ clang/test/CodeGen/lit.local.cfg @@ -0,0 +1,9 @@ +# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79: +from lit.llvm.subst import ToolSubst + +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')) + Index: clang/test/CodeGen/cmse-clear-return.c === --- clang/test/CodeGen/cmse-clear-return.c +++ clang/test/CodeGen/cmse-clear-return.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple thumbv8m.main -O0 -mcmse -S -emit-llvm %s -o - | \ // RUN:FileCheck %s --check-prefixes=CHECK,CHECK-LE,CHECK-LE-NOPT,CHECK-SOFT // RUN: %clang_cc1 -triple thumbebv8m.main -O0 -mcmse -S -emit-llvm %s -o - | \ -// RUN:FileCheck %s --check-prefixes=CHECK,CHECK-BE,CHECK-BE-NOPT,CHECK-SOFT +// RUN:FileCheck %s --check-prefixes=CHECK,CHECK-BE,CHECK-SOFT // RUN: %clang_cc1 -triple thumbv8m.main -O2 -mcmse -S -emit-llvm %s -o - | \ // RUN:FileCheck %s --check-prefixes=CHECK,CHECK-LE,CHECK-LE-OPT,CHECK-SOFT // RUN: %clang_cc1 -triple thumbebv8m.main -O2 -mcmse -S -emit-llvm %s -o - | \ Index: clang/test/CodeGen/catch-pointer-overflow.c === --- clang/test/CodeGen/catch-pointer-overflow.c +++ clang/test/CodeGen/catch-pointer-overflow.c @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE +// RUN: %clang_cc1 -x c -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s // RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE // RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-RECOVER // RUN: %clang_cc1 -x c -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-C,CHECK-SANITIZE-TRAP,CHECK-SANITIZE-UNREACHABLE -// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-NOSANITIZE +// RUN: %clang_cc1 -x c++ -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s // RUN: %clang_cc1 -x c++ -fsanitize=pointer-overflow -fno-sanitize-recover=pointer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s -implicit-check-not="call void @__ubsan_handle_pointer_overflow" --check-prefixes=CHECK,CHECK-SANITIZE,CHECK-SANITIZE-CPP,CHECK-SANITIZE-ANYRECOVER,CHECK-SANITIZE-NORECOVER,CHECK-SANITIZE-UNREACHABLE // RUN: %clang_cc1 -x c++ -fsanitize=point