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