Eli Friedman | 3c54801 | 2009-06-10 01:32:39 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -pedantic -verify %s |
| 2 | |
| 3 | int test['\\' == 92 ? 1 : -1]; |
| 4 | int test['\"' == 34 ? 1 : -1]; |
| 5 | int test['\'' == 39 ? 1 : -1]; |
| 6 | int test['\?' == 63 ? 1 : -1]; |
| 7 | int test['\a' == 7 ? 1 : -1]; |
| 8 | int test['\b' == 8 ? 1 : -1]; |
| 9 | int test['\e' == 27 ? 1 : -1]; // expected-warning {{non-standard escape}} |
| 10 | int test['\E' == 27 ? 1 : -1]; // expected-warning {{non-standard escape}} |
| 11 | int test['\f' == 12 ? 1 : -1]; |
| 12 | int test['\n' == 10 ? 1 : -1]; |
| 13 | int test['\r' == 13 ? 1 : -1]; |
| 14 | int test['\t' == 9 ? 1 : -1]; |
| 15 | int test['\v' == 11 ? 1 : -1]; |
| 16 | int test['\xa' == 10 ? 1 : -1]; |
| 17 | int test['\1' == 1 ? 1 : -1]; |
| 18 | int test['\(' == 40 ? 1 : -1]; // expected-warning {{non-standard escape}} |
| 19 | int test['\{' == 123 ? 1 : -1]; // expected-warning {{non-standard escape}} |
| 20 | int test['\[' == 91 ? 1 : -1]; // expected-warning {{non-standard escape}} |
| 21 | int test['\%' == 37 ? 1 : -1]; // expected-warning {{non-standard escape}} |