]> granicus.if.org Git - clang/commit
[VerifyDiagnosticConsumer] support -verify=<prefixes>
authorHal Finkel <hfinkel@anl.gov>
Sat, 16 Dec 2017 02:23:22 +0000 (02:23 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 16 Dec 2017 02:23:22 +0000 (02:23 +0000)
commitc29edbf9986b8a1815f288c74a9bc9c75db691b3
treec39014c109da48f90fe28583eec307d5dc0426a5
parentab88c4b23f7ee1a3e77a801ef059cb29161233da
[VerifyDiagnosticConsumer] support -verify=<prefixes>

This mimics FileCheck's --check-prefixes option.

The default prefix is "expected". That is, "-verify" is equivalent to
"-verify=expected".

The goal is to permit exercising a single test suite source file with different
compiler options producing different sets of diagnostics.  While cpp can be
combined with the existing -verify to accomplish the same goal, source is often
easier to maintain when it's not cluttered with preprocessor directives or
duplicate passages of code. For example, this patch also rewrites some existing
clang tests to demonstrate the benefit of this feature.

Patch by Joel E. Denny, thanks!

Differential Revision: https://reviews.llvm.org/D39694

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320908 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticDriverKinds.td
include/clang/Basic/DiagnosticOptions.h
include/clang/Driver/CC1Options.td
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/VerifyDiagnosticConsumer.cpp
test/Frontend/diagnostics-order.c
test/Frontend/verify-prefixes.c [new file with mode: 0644]
test/Sema/tautological-unsigned-enum-zero-compare.c
test/Sema/tautological-unsigned-enum-zero-compare.cpp
test/Sema/tautological-unsigned-zero-compare.c