(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
raw-string-directive-2.c
       1  /* { dg-do run } */
       2  /* { dg-options "-std=gnu99" { target c } } */
       3  /* { dg-options "-std=c++11" { target c++ } } */
       4  
       5  #define S1 R"(three
       6  line
       7  string)"
       8  
       9  #define S2 R"(pasted
      10  two line)" " string"
      11  
      12  #define X(a, b) a b R"(
      13  one more)"
      14  
      15  const char *s1 = S1;
      16  const char *s2 = S2;
      17  const char *s3 = X(S1, R"(
      18  with this line plus)");
      19  
      20  int main ()
      21  {
      22    const char s1_correct[] = "three\nline\nstring";
      23    if (__builtin_memcmp (s1, s1_correct, sizeof s1_correct))
      24      __builtin_abort ();
      25  
      26    const char s2_correct[] = "pasted\ntwo line string";
      27    if (__builtin_memcmp (s2, s2_correct, sizeof s2_correct))
      28      __builtin_abort ();
      29  
      30    const char s3_correct[] = "three\nline\nstring\nwith this line plus\none more";
      31    if (__builtin_memcmp (s3, s3_correct, sizeof s3_correct))
      32      __builtin_abort ();
      33  }