24 lines · c
1// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s2// RUN: %clang_cc1 -fsyntax-only -pedantic -fexperimental-new-constant-interpreter -verify %s3 4int test['\\' == 92 ? 1 : -1];5int test['\"' == 34 ? 1 : -1];6int test['\'' == 39 ? 1 : -1];7int test['\?' == 63 ? 1 : -1];8int test['\a' == 7 ? 1 : -1];9int test['\b' == 8 ? 1 : -1];10int test['\e' == 27 ? 1 : -1]; // expected-warning {{non-standard escape}}11int test['\E' == 27 ? 1 : -1]; // expected-warning {{non-standard escape}}12int test['\f' == 12 ? 1 : -1];13int test['\n' == 10 ? 1 : -1];14int test['\r' == 13 ? 1 : -1];15int test['\t' == 9 ? 1 : -1];16int test['\v' == 11 ? 1 : -1];17int test['\xa' == 10 ? 1 : -1];18int test['\1' == 1 ? 1 : -1];19int test['\(' == 40 ? 1 : -1]; // expected-warning {{non-standard escape}}20int test['\{' == 123 ? 1 : -1]; // expected-warning {{non-standard escape}}21int test['\[' == 91 ? 1 : -1]; // expected-warning {{non-standard escape}}22int test['\%' == 37 ? 1 : -1]; // expected-warning {{non-standard escape}}23const char *format = "abc \m def"; // expected-warning{{unknown escape sequence '\m'}}24