File: mangling_gh1519.d

package info (click to toggle)
ldc 1%3A1.24.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 53,728 kB
  • sloc: cpp: 55,939; ansic: 10,599; sh: 958; makefile: 801; asm: 507; objc: 122; exp: 30; python: 12
file content (33 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (4)
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
// Test for Github issue 1519

// Check that .mangleof strings do not contain any char 0x01.
// LDC may prepend 0x01 to prevent LLVM from modifying the symbol name, but it should not appear in user code.

// RUN: %ldc -c %s

extern (C) void fooC()
{
}

extern (C++) void fooCpp()
{
}

extern (D) void fooD()
{
}

void aliasTemplate(alias F)()
{
    F();
}

void main()
{
    import std.algorithm;

    static assert(all!"a != '\1'"(fooC.mangleof));
    static assert(all!"a != '\1'"(fooCpp.mangleof));
    static assert(all!"a != '\1'"(fooD.mangleof));
    static assert(all!"a != '\1'"(aliasTemplate!fooCpp.mangleof));
}