From 810940f3ec030776837dc8b349c18f9f45e4215b Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Fri, 17 Jan 2014 03:21:54 +0000 Subject: [PATCH] Make -verify a -cc1 NoDriverOption '%clang -verify' will now issue an error instead of succeeding without verification. This should catch flawed tests like r199347. Followup to r199451. llvm-svn: 199455 --- clang/include/clang/Driver/CC1Options.td | 2 ++ clang/include/clang/Driver/Options.td | 2 -- clang/test/Misc/driver-verify.c | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 clang/test/Misc/driver-verify.c diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td index 97511e560aa7..e707cd8e193b 100644 --- a/clang/include/clang/Driver/CC1Options.td +++ b/clang/include/clang/Driver/CC1Options.td @@ -254,6 +254,8 @@ def fconstexpr_backtrace_limit : Separate<["-"], "fconstexpr-backtrace-limit">, HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit).">; def fmessage_length : Separate<["-"], "fmessage-length">, MetaVarName<"">, HelpText<"Format message diagnostics so that they fit within N columns or fewer, when possible.">; +def verify : Flag<["-"], "verify">, + HelpText<"Verify diagnostic output using comment directives">; def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">, HelpText<"Silence ObjC rewriting warnings">; diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 48dd69ba2414..78d59f0a379f 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1295,8 +1295,6 @@ def unexported__symbols__list : Separate<["-"], "unexported_symbols_list">; def u : JoinedOrSeparate<["-"], "u">, Group; def v : Flag<["-"], "v">, Flags<[CC1Option]>, HelpText<"Show commands to run and use verbose output">; -def verify : Flag<["-"], "verify">, Flags<[CC1Option]>, - HelpText<"Verify diagnostic output using comment directives">; def verify_debug_info : Flag<["--"], "verify-debug-info">, Flags<[DriverOption]>, HelpText<"Verify the binary representation of debug output">; def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>; diff --git a/clang/test/Misc/driver-verify.c b/clang/test/Misc/driver-verify.c new file mode 100644 index 000000000000..87b5c951d77a --- /dev/null +++ b/clang/test/Misc/driver-verify.c @@ -0,0 +1,6 @@ +// RUN: not %clang %s -verify 2>&1 | FileCheck %s +// RUN: %clang -cc1 -verify %s +// expected-no-diagnostics + +// Test that -verify is strictly rejected as unknown by the driver. +// CHECK: unknown argument: '-verify'