| Daniel Jasper | 7b8d263 | 2014-04-02 08:52:06 +0000 | [diff] [blame] | 1 | // RUN: clang-tidy -disable-checks='' %s.nonexistent.cpp -- | FileCheck -check-prefix=CHECK1 %s |
| 2 | // RUN: clang-tidy -disable-checks='' %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK2 %s |
| 3 | // RUN: clang-tidy -checks='(google-explicit-constructor|clang-diagnostic-literal-conversion)' -disable-checks='' %s -- -fan-unknown-option | FileCheck -check-prefix=CHECK3 %s |
| Alexander Kornienko | 238795e | 2014-05-06 08:10:00 +0000 | [diff] [blame] | 4 | // RUN: clang-tidy -checks='clang-diagnostic-macro-redefined' -disable-checks='' %s -- -DMACRO_FROM_COMMAND_LINE | FileCheck -check-prefix=CHECK4 %s |
| Alexander Kornienko | 6d129d5 | 2014-02-03 15:55:35 +0000 | [diff] [blame] | 5 | |
| Alexander Kornienko | 09952d2 | 2014-03-20 09:38:22 +0000 | [diff] [blame] | 6 | // CHECK1-NOT: warning |
| 7 | // CHECK2-NOT: warning |
| 8 | // CHECK3-NOT: warning |
| 9 | |
| 10 | // CHECK1: warning: error reading '{{.*}}.nonexistent.cpp' |
| 11 | // CHECK2: warning: unknown argument: '-fan-unknown-option' |
| 12 | |
| 13 | // CHECK2: :[[@LINE+2]]:9: warning: implicit conversion from 'double' to 'int' changes value |
| 14 | // CHECK3: :[[@LINE+1]]:9: warning: implicit conversion from 'double' to 'int' changes value |
| 15 | int a = 1.5; |
| 16 | |
| 17 | // CHECK2: :[[@LINE+2]]:11: warning: Single-argument constructors must be explicit [google-explicit-constructor] |
| 18 | // CHECK3: :[[@LINE+1]]:11: warning: Single-argument constructors must be explicit [google-explicit-constructor] |
| 19 | class A { A(int) {} }; |
| 20 | |
| 21 | // CHECK2-NOT: warning: |
| 22 | // CHECK3-NOT: warning: |
| Alexander Kornienko | 238795e | 2014-05-06 08:10:00 +0000 | [diff] [blame] | 23 | |
| 24 | #define MACRO_FROM_COMMAND_LINE |
| 25 | // CHECK4: :[[@LINE-1]]:9: warning: 'MACRO_FROM_COMMAND_LINE' macro redefined |