Chris Lattner | 2b07d8f | 2009-04-16 04:32:54 +0000 | [diff] [blame] | 1 | // This should warn by default. |
| 2 | // RUN: clang-cc %s 2>&1 | grep "warning:" && |
| 3 | |
| 4 | // This should not emit anything. |
| 5 | // RUN: clang-cc %s -w 2>&1 | not grep diagnostic && |
| 6 | // RUN: clang-cc %s -Wno-#warnings 2>&1 | not grep diagnostic && |
| 7 | |
| 8 | // -Werror can map all warnings to error. |
| 9 | // RUN: clang-cc %s -Werror 2>&1 | grep "error:" && |
| 10 | |
| 11 | // -Werror can map this one warning to error. |
| 12 | // RUN: clang-cc %s -Werror=#warnings 2>&1 | grep "error:" && |
| 13 | |
| 14 | // -Wno-error= overrides -Werror. rdar://3158301 |
Shantonu Sen | b1d76bd | 2009-08-14 04:07:15 +0000 | [diff] [blame] | 15 | // RUN: clang-cc %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:" && |
| 16 | |
| 17 | // -Wno-error overrides -Werror. PR4715 |
| 18 | // RUN: clang-cc %s -Werror -Wno-error 2>&1 | grep "warning:" |
Chris Lattner | 2b07d8f | 2009-04-16 04:32:54 +0000 | [diff] [blame] | 19 | |
| 20 | #warning foo |
| 21 | |
| 22 | |