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