Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Lexer / raw-string-ext.c
blobde318b616df709b07ce1da801a15249fa0aec9c9
1 // RUN: %clang_cc1 -fsyntax-only -std=gnu11 -verify=supported %s
2 // RUN: %clang_cc1 -fsyntax-only -std=c11 -DUNICODE -fraw-string-literals -verify=supported %s
3 // RUN: %clang_cc1 -fsyntax-only -std=gnu89 -verify=unsupported %s
4 // RUN: %clang_cc1 -fsyntax-only -std=c11 -DUNICODE -verify=unsupported %s
5 // RUN: %clang_cc1 -fsyntax-only -std=gnu11 -DUNICODE -fno-raw-string-literals -verify=unsupported %s
7 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++03 -verify=unsupported,cxx-unsupported %s
8 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++03 -verify=unsupported,cxx-unsupported %s
9 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++03 -fraw-string-literals -verify=supported %s
10 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++03 -fraw-string-literals -verify=supported %s
11 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++11 -DUNICODE -verify=supported,cxx %s
12 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++11 -DUNICODE -verify=supported,cxx %s
13 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++11 -DUNICODE -fraw-string-literals -verify=supported,yes %s
14 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++11 -DUNICODE -fraw-string-literals -verify=supported,yes %s
15 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++11 -DUNICODE -fno-raw-string-literals -verify=supported,no %s
16 // RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++11 -DUNICODE -fno-raw-string-literals -verify=supported,no %s
18 // GCC supports raw string literals in C99 and later in '-std=gnuXY' mode; we
19 // additionally provide '-f[no-]raw-string-literals' to enable/disable them
20 // explicitly in C.
22 // We do not allow disabling raw string literals in C++ mode if they’re enabled
23 // by the language standard, i.e. in C++11 or later.
25 // Driver warnings.
26 // yes-warning@* {{ignoring '-fraw-string-literals'}}
27 // no-warning@* {{ignoring '-fno-raw-string-literals'}}
29 void f() {
30 (void) R"foo()foo"; // unsupported-error {{use of undeclared identifier 'R'}} cxx-unsupported-error {{expected ';' after expression}}
31 (void) LR"foo()foo"; // unsupported-error {{use of undeclared identifier 'LR'}} cxx-unsupported-error {{expected ';' after expression}}
33 #ifdef UNICODE
34 (void) uR"foo()foo"; // unsupported-error {{use of undeclared identifier 'uR'}} cxx-unsupported-error {{expected ';' after expression}}
35 (void) u8R"foo()foo"; // unsupported-error {{use of undeclared identifier 'u8R'}} cxx-unsupported-error {{expected ';' after expression}}
36 (void) UR"foo()foo"; // unsupported-error {{use of undeclared identifier 'UR'}} cxx-unsupported-error {{expected ';' after expression}}
37 #endif
40 // supported-error@* {{missing terminating delimiter}}
41 // supported-error@* {{expected expression}}
42 // supported-error@* {{expected ';' after top level declarator}}
43 #define R "bar"
44 const char* s = R"foo(";