]> granicus.if.org Git - clang/commitdiff
Fixed some rtti-options tests.
authorSunil Srivastava <sunil_srivastava@playstation.sony.com>
Tue, 15 May 2018 18:28:42 +0000 (18:28 +0000)
committerSunil Srivastava <sunil_srivastava@playstation.sony.com>
Tue, 15 May 2018 18:28:42 +0000 (18:28 +0000)
Certain tests in rtti-options.cpp are not really testing anything because they are testing for the absence of -frtti option to the cc1 process. Since the cc1 process does not take -frtti option, these tests are passing tautologically.

The RTTI mode is enabled by default in cc1, and -fno-rtti disables it. Therefore the correct way to check for enabling of RTTI is to check for the absence of -fno-rtti to cc1, and the correct way to check for disabling of RTTI is to check for the presence of -fno-rtti to cc1.

This patch fixes those tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332384 91177308-0d34-0410-b5e6-96231b3b80d8

test/Driver/rtti-options.cpp

index 954e00dfda94818d5c62302300cc85208ccbe5d8..131c858fb37f22cc46b40b412a55fc8fce4087e8 100644 (file)
@@ -5,8 +5,8 @@
 
 // Special cases: -fcxx-exceptions in C code should warn about unused arguments
 // We should also not have any rtti-related arguments
-// RUN: %clang -x c -### -target x86_64-scei-ps4 -c -fcxx-exceptions %s 2>&1 | FileCheck -check-prefix=CHECK-UNUSED -check-prefix=CHECK-RTTI -check-prefix=CHECK-NO-RTTI %s
-// RUN: %clang -x c -### -target x86_64-unknown-unknown -c -fcxx-exceptions %s 2>&1 | FileCheck -check-prefix=CHECK-UNUSED -check-prefix=CHECK-RTTI -check-prefix=CHECK-NO-RTTI %s
+// RUN: %clang -x c -### -target x86_64-scei-ps4 -c -fcxx-exceptions %s 2>&1 | FileCheck -check-prefix=CHECK-UNUSED -check-prefix=CHECK-RTTI %s
+// RUN: %clang -x c -### -target x86_64-unknown-unknown -c -fcxx-exceptions %s 2>&1 | FileCheck -check-prefix=CHECK-UNUSED -check-prefix=CHECK-RTTI %s
 
 // Make sure we keep the last -frtti/-fno-rtti argument
 // RUN: %clang -### -c -fno-rtti -frtti %s 2>&1 | FileCheck -check-prefix=CHECK-RTTI %s
@@ -56,6 +56,6 @@
 // CHECK-EXC-ERROR: invalid argument '-fno-rtti' not allowed with '-fexceptions'
 // CHECK-EXC-ERROR-CXX: invalid argument '-fno-rtti' not allowed with '-fcxx-exceptions'
 // CHECK-RTTI-NOT: "-fno-rtti"
-// CHECK-NO-RTTI-NOT: "-frtti"
+// CHECK-NO-RTTI: "-fno-rtti"
 
 // CHECK-OK-NOT: {{warning:|error:}}