view gcc/testsuite/c-c++-common/raw-string-9.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

// Make sure that we properly handle trigraphs in raw strings when
// trigraphs are disabled, too.
// { dg-options "-std=gnu99" { target c } }
// { dg-options "-std=gnu++0x" { target c++ } }
// { dg-do run }

const char b[] = "??>";		// { dg-message "-trigraphs" }
const char a[] = R"(??>??)??/
??)";

#define TEST(str, val) \
  if (sizeof (str) != sizeof (val) \
      || __builtin_memcmp (str, val, sizeof (str)) != 0) \
    __builtin_abort ()

int main()
{
  TEST (a, "?\?>?\?)?\?/\n?\?");
}