blob: 7297c27e1f9ea78ea174e1791fcaf64468e938a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Test raw string literals.
//TEST:EXECUTABLE:
__target_intrinsic(cpp, R"delim(printf("%c", $0))delim")
void writeChar(int8_t ch);
void printLines(NativeString text)
{
NativeString str = text;
int8_t *ptr = bit_cast<Ptr<int8_t>>(str);
for (int i = 0; i < text.length; i++)
{
if (ptr[i] != 13)
{
writeChar(ptr[i]);
}
}
}
export __extern_cpp int main()
{
printLines(
R"(This is line 1.
This is line 2.
"Hello World"
)");
return 0;
}
|