aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail196.d
blob: 78fc3615c957cb3cf40dcff24c6e6961176db7f1 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
TEST_OUTPUT:
---
fail_compilation/fail196.d(26): Error: delimited string must end in )"
fail_compilation/fail196.d(26): Error: Implicit string concatenation is error-prone and disallowed in D
fail_compilation/fail196.d(26):        Use the explicit syntax instead (concatenating literals is `@nogc`): "foo(xxx)" ~ ";\x0a    assert(s == "
fail_compilation/fail196.d(27): Error: semicolon expected, not `foo`
fail_compilation/fail196.d(27): Error: found `");\x0a\x0a    s = q"` when expecting `;` following statement
fail_compilation/fail196.d(29): Error: found `";\x0a    assert(s == "` when expecting `;` following statement
fail_compilation/fail196.d(30): Error: found `");\x0a\x0a    s = q"` when expecting `;` following statement
fail_compilation/fail196.d(32): Error: found `{` when expecting `;` following statement
fail_compilation/fail196.d(32): Error: found `}` when expecting `;` following statement
fail_compilation/fail196.d(33): Error: found `foo` when expecting `;` following statement
fail_compilation/fail196.d(33): Error: found `}` when expecting `;` following statement
fail_compilation/fail196.d(35): Error: found `<` when expecting `;` following statement
fail_compilation/fail196.d(36): Error: found `foo` when expecting `;` following statement
fail_compilation/fail196.d(36): Error: found `<` instead of statement
fail_compilation/fail196.d(42): Error: unterminated string constant starting at fail_compilation/fail196.d(42)
fail_compilation/fail196.d(44): Error: found `End of File` when expecting `}` following compound statement
fail_compilation/fail196.d(44): Error: found `End of File` when expecting `}` following compound statement
---
*/

void main()
{
    string s = q"(foo(xxx)) ";
    assert(s == "foo(xxx)");

    s = q"[foo[xxx]]";
    assert(s == "foo[xxx]");

    s = q"{foo{xxx}}";
    assert(s == "foo{xxx}");

    s = q"<foo<xxx>>";
    assert(s == "foo<xxx>");

    s = q"[foo(]";
    assert(s == "foo(");

    s = q"/foo]/";
    assert(s == "foo]");
}