mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
145 lines
3 KiB
D
145 lines
3 KiB
D
/*
|
|
REQUIRED_ARGS: -HC=verbose -o- -Icompilable/extra-files
|
|
PERMUTE_ARGS:
|
|
EXTRA_FILES: extra-files/dtoh_imports.d extra-files/dtoh_imports2.d
|
|
|
|
TEST_OUTPUT:
|
|
---
|
|
// Automatically generated by Digital Mars D Compiler v$n$
|
|
|
|
#pragma once
|
|
|
|
#include <assert.h>
|
|
#include <math.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
extern void importFunc();
|
|
|
|
// Ignored function dtoh_verbose.foo because of linkage
|
|
// Ignored variable dtoh_verbose.i because of linkage
|
|
// Ignored function dtoh_verbose.bar because of linkage
|
|
// Ignored struct dtoh_verbose.S because of linkage
|
|
// Ignored class dtoh_verbose.C because of linkage
|
|
// Ignored function dtoh_verbose.bar because it is extern
|
|
// Ignored variable dtoh_verbose.i1 because of linkage
|
|
// Ignored template dtoh_verbose.templ(T)(T t) because of linkage
|
|
// Ignored alias dtoh_verbose.inst because of linkage
|
|
// Ignored enum dtoh_verbose.arrayOpaque because of its base type
|
|
// Ignored renamed import `myFunc = importFunc` because `using` only supports types
|
|
struct A final
|
|
{
|
|
// Ignored renamed import `myFunc = importFunc` because `using` only supports types
|
|
A()
|
|
{
|
|
}
|
|
};
|
|
|
|
struct Hidden final
|
|
{
|
|
// Ignored function dtoh_verbose.Hidden.hidden because it is private
|
|
Hidden()
|
|
{
|
|
}
|
|
};
|
|
|
|
// Ignored alias dtoh_verbose.D because of linkage
|
|
class Visitor
|
|
{
|
|
public:
|
|
virtual void stat();
|
|
// Ignored dtoh_verbose.Visitor.bar because `using` cannot rename functions in aggregates
|
|
// Ignored dtoh_verbose.Visitor.unused because free functions cannot be aliased in C++
|
|
};
|
|
|
|
extern void unused();
|
|
|
|
// Ignored variable dtoh_verbose.and because its name is a special operator in C++
|
|
template <typename T>
|
|
struct FullImportTmpl final
|
|
{
|
|
// Ignored `dtoh_imports` because it's inside of a template declaration
|
|
FullImportTmpl()
|
|
{
|
|
}
|
|
};
|
|
|
|
template <typename T>
|
|
struct SelectiveImportsTmpl final
|
|
{
|
|
// Ignored `__anonymous` because it's inside of a template declaration
|
|
SelectiveImportsTmpl()
|
|
{
|
|
}
|
|
};
|
|
---
|
|
*/
|
|
|
|
void foo() {}
|
|
|
|
extern (D) {
|
|
int i;
|
|
}
|
|
|
|
void bar();
|
|
|
|
struct S {}
|
|
|
|
class C {}
|
|
|
|
extern(C++) void bar();
|
|
|
|
int i1;
|
|
|
|
void templ(T)(T t) {}
|
|
|
|
alias inst = templ!int;
|
|
|
|
extern(C++)
|
|
enum arrayOpaque : int[4];
|
|
|
|
public import dtoh_imports : myFunc = importFunc;
|
|
|
|
extern(C++) struct A
|
|
{
|
|
public import dtoh_imports : myFunc = importFunc;
|
|
}
|
|
|
|
extern(C++) struct Hidden
|
|
{
|
|
private void hidden() {}
|
|
}
|
|
|
|
private {
|
|
enum PI = 4;
|
|
}
|
|
|
|
alias D = size_t delegate (size_t x);
|
|
|
|
extern(C++) T foo(T) = T.init;
|
|
|
|
extern(C++) class Visitor
|
|
{
|
|
void stat() {}
|
|
|
|
// Ignored because those cannot be represented in C++
|
|
alias bar = stat;
|
|
alias unused = .unused;
|
|
}
|
|
|
|
extern(C++) void unused() {}
|
|
|
|
extern(C++) __gshared bool and;
|
|
|
|
extern(C++) struct FullImportTmpl(T)
|
|
{
|
|
public import dtoh_imports;
|
|
|
|
}
|
|
|
|
extern(C++) struct SelectiveImportsTmpl(T)
|
|
{
|
|
public import dtoh_imports :
|
|
importFunc,
|
|
aliasName = ImportsC;
|
|
}
|