|
12 | 12 | //--- include/header2.h |
13 | 13 | //--- include/header3.h |
14 | 14 | //--- include/header4.h |
| 15 | +//--- include/header5.h |
| 16 | +//--- include/header6.h |
| 17 | +//--- include/header7.h |
| 18 | +//--- include/header8.h |
| 19 | +//--- include/header9.h |
| 20 | +//--- include/header10.h |
| 21 | +//--- include/header11.h |
| 22 | +//--- include/header12.h |
| 23 | +//--- include/header13.h |
| 24 | +//--- include/header14.h |
15 | 25 | //--- tu.c |
16 | 26 | #if 0 |
17 | 27 | R"x()x" |
@@ -47,9 +57,92 @@ R"z()y"; |
47 | 57 | //")z" |
48 | 58 | #endif |
49 | 59 |
|
| 60 | +// Test u8 prefix with escaped newline |
| 61 | +#if 0 |
| 62 | +u8R\ |
| 63 | +"prefix(test)prefix" |
| 64 | +#endif |
| 65 | +#include "header5.h" |
| 66 | + |
| 67 | +// Test u prefix with multiple escaped newlines |
| 68 | +#if 0 |
| 69 | +uR\ |
| 70 | +\ |
| 71 | +"multi(test)multi" |
| 72 | +#endif |
| 73 | +#include "header6.h" |
| 74 | + |
| 75 | +// Test U prefix with escaped newline |
| 76 | +#if 0 |
| 77 | +UR\ |
| 78 | +"upper(test)upper" |
| 79 | +#endif |
| 80 | +#include "header7.h" |
| 81 | + |
| 82 | +// Test L prefix with escaped newline |
| 83 | +#if 0 |
| 84 | +LR\ |
| 85 | +"wide(test)wide" |
| 86 | +#endif |
| 87 | +#include "header8.h" |
| 88 | + |
| 89 | +// Test escaped newline with \r\n style |
| 90 | +#if 0 |
| 91 | +R\ |
| 92 | +"crlf(test)crlf" |
| 93 | +#endif |
| 94 | +#include "header9.h" |
| 95 | + |
| 96 | +// Test multiple escaped newlines in different positions |
| 97 | +#if 0 |
| 98 | +u\ |
| 99 | +8\ |
| 100 | +R\ |
| 101 | +"complex(test)complex" |
| 102 | +#endif |
| 103 | +#include "header10.h" |
| 104 | + |
| 105 | +// Test raw string that should NOT be treated as raw (no R prefix due to identifier continuation) |
| 106 | +#if 0 |
| 107 | +identifierR"notraw(test)notraw" |
| 108 | +#endif |
| 109 | +#include "header11.h" |
| 110 | + |
| 111 | +// Test raw string with whitespace before escaped newline |
| 112 | +#if 0 |
| 113 | +R \ |
| 114 | +"whitespace(test)whitespace" |
| 115 | +#endif |
| 116 | +#include "header12.h" |
| 117 | + |
| 118 | +// Test nested raw strings in disabled code |
| 119 | +#if 0 |
| 120 | +R"outer( |
| 121 | + R"inner(content)inner" |
| 122 | +)outer" |
| 123 | +#endif |
| 124 | +#include "header13.h" |
| 125 | + |
| 126 | +// Test raw string with empty delimiter |
| 127 | +#if 0 |
| 128 | +R\ |
| 129 | +"(empty delimiter)"; |
| 130 | +#endif |
| 131 | +#include "header14.h" |
| 132 | + |
50 | 133 | // RUN: clang-scan-deps -compilation-database %t/cdb.json -mode preprocess | FileCheck %s |
51 | 134 | // RUN: clang-scan-deps -compilation-database %t/cdb.json -mode preprocess-dependency-directives | FileCheck %s |
52 | 135 | // CHECK: tu.c |
53 | 136 | // CHECK-NEXT: header.h |
54 | 137 | // CHECK-NEXT: header3.h |
55 | 138 | // CHECK-NEXT: header4.h |
| 139 | +// CHECK-NEXT: header5.h |
| 140 | +// CHECK-NEXT: header6.h |
| 141 | +// CHECK-NEXT: header7.h |
| 142 | +// CHECK-NEXT: header8.h |
| 143 | +// CHECK-NEXT: header9.h |
| 144 | +// CHECK-NEXT: header10.h |
| 145 | +// CHECK-NEXT: header11.h |
| 146 | +// CHECK-NEXT: header12.h |
| 147 | +// CHECK-NEXT: header13.h |
| 148 | +// CHECK-NEXT: header14.h |
0 commit comments