teak-llvm/clang/test/Frontend/diagnostics-order.c
Hal Finkel 05e4648482 [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

llvm-svn: 320908
2017-12-16 02:23:22 +00:00

13 lines
631 B
C

// Make sure a note stays with its associated command-line argument diagnostic.
// Previously, these diagnostics were grouped by diagnostic level with all
// notes last.
//
// RUN: not %clang_cc1 -O999 -std=bogus -verify=-foo %s 2> %t
// RUN: FileCheck < %t %s
//
// CHECK: error: invalid value '-foo' in '-verify='
// CHECK-NEXT: note: -verify prefixes must start with a letter and contain only alphanumeric characters, hyphens, and underscores
// CHECK-NEXT: warning: optimization level '-O999' is not supported
// CHECK-NEXT: error: invalid value 'bogus' in '-std=bogus'
// CHECK-NEXT: note: use {{.*}} for {{.*}} standard