Test for warning being silenced
authorSylvestre Ledru <sylvestre@debian.org>
Fri, 11 Jul 2014 17:23:13 +0000 (17:23 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Fri, 11 Jul 2014 17:23:13 +0000 (17:23 +0000)
Summary:
Added some tests to see if the new warning would be silenced with a flag.

Patch by Arthur Marble <arthur@info9.net> in the context of Debian Google Summer of code 2014.

Reviewers: sylvestre.ledru

Reviewed By: sylvestre.ledru

Differential Revision: http://reviews.llvm.org/D4475

llvm-svn: 212833

clang/test/Driver/clang_f_opts.c

index 3971216..f31e9e2 100644 (file)
 // CHECK-WARNING1: ignoring unsupported optimization flag '-finline-limit=1000'
 // CHECK-WARNING2: ignoring unsupported optimization flag '-finline-limit'
 
+// Test that we mute the warning on these
+// RUN: %clang -### -finline-limit=1000 -Wno-unused-command-line-argument               \
+// RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING1 %s
+// RUN: %clang -### -finline-limit -Wno-unused-command-line-argument                    \
+// RUN:     %s 2>&1 | FileCheck --check-prefix=CHECK-NO-WARNING2 %s
+// CHECK-NO-WARNING1-NOT: ignoring unsupported optimization flag '-finline-limit=1000'
+// CHECK-NO-WARNING2-NOT: ignoring unsupported optimization flag '-finline-limit'
+
+
 // RUN: %clang -### -fshort-wchar -fno-short-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR1 %s
 // RUN: %clang -### -fno-short-wchar -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-WCHAR2 %s
 // CHECK-WCHAR1: -fno-short-wchar