brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 8ed96e5 Raw
45 lines · c
1// RUN: %clang_cc1 -fsyntax-only -std=gnu11 -verify=supported %s2// RUN: %clang_cc1 -fsyntax-only -std=c11 -DUNICODE -fraw-string-literals -verify=supported %s3// RUN: %clang_cc1 -fsyntax-only -std=gnu89 -verify=unsupported %s4// RUN: %clang_cc1 -fsyntax-only -std=c11 -DUNICODE -verify=unsupported %s5// RUN: %clang_cc1 -fsyntax-only -std=gnu11 -DUNICODE -fno-raw-string-literals -verify=unsupported %s6 7// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++03 -verify=unsupported,cxx-unsupported %s8// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++03 -verify=unsupported,cxx-unsupported %s9// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++03 -fraw-string-literals -verify=supported %s10// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++03 -fraw-string-literals -verify=supported %s11// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++11 -DUNICODE -verify=supported,cxx %s12// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++11 -DUNICODE -verify=supported,cxx %s13// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++11 -DUNICODE -fraw-string-literals -verify=supported,yes %s14// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++11 -DUNICODE -fraw-string-literals -verify=supported,yes %s15// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=c++11 -DUNICODE -fno-raw-string-literals -verify=supported,no %s16// RUN: %clang_cc1 -x c++ -fsyntax-only -Wno-unused -std=gnu++11 -DUNICODE -fno-raw-string-literals -verify=supported,no %s17 18// GCC supports raw string literals in C99 and later in '-std=gnuXY' mode; we19// additionally provide '-f[no-]raw-string-literals' to enable/disable them20// explicitly in C.21//22// We do not allow disabling raw string literals in C++ mode if they’re enabled23// by the language standard, i.e. in C++11 or later.24 25// Driver warnings.26// yes-warning@* {{ignoring '-fraw-string-literals'}}27// no-warning@* {{ignoring '-fno-raw-string-literals'}}28 29void f() {30  (void) R"foo()foo"; // unsupported-error {{use of undeclared identifier 'R'}}31  (void) LR"foo()foo"; // unsupported-error {{use of undeclared identifier 'LR'}}32 33#ifdef UNICODE34  (void) uR"foo()foo"; // unsupported-error {{use of undeclared identifier 'uR'}}35  (void) u8R"foo()foo"; // unsupported-error {{use of undeclared identifier 'u8R'}}36  (void) UR"foo()foo"; // unsupported-error {{use of undeclared identifier 'UR'}}37#endif38}39 40// supported-error@* {{missing terminating delimiter}}41// supported-error@* {{expected expression}}42// supported-error@* {{expected ';' after top level declarator}}43#define R "bar"44const char* s =  R"foo(";45