mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 09:31:03 +03:00

Windows x64 ABI: remove unnecessary \01 from mangled symbol name. This removes the 0x1 byte from `.mangleof` accessible from user code. Resolves issue #1519 Also let mangleForLLVM take a std::string, to enable C++11's moves.
33 lines
622 B
D
33 lines
622 B
D
// 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));
|
|
}
|