ldc/tests/codegen/mangling_gh1519.d
Johan Engelen 04b89e642c Windows: Move the prepending of 0x1 to C++ mangled functions from frontend to the backend.
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.
2016-05-30 10:18:39 +02:00

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));
}