| 1 |
/* |
| 2 |
REQUIRED_ARGS: -HC=verbose -o- -Icompilable/extra-files |
| 3 |
PERMUTE_ARGS: |
| 4 |
EXTRA_FILES: extra-files/dtoh_imports.d extra-files/dtoh_imports2.d |
| 5 |
|
| 6 |
TEST_OUTPUT: |
| 7 |
--- |
| 8 |
// Automatically generated by Digital Mars D Compiler v$n$ |
| 9 |
|
| 10 |
#pragma once |
| 11 |
|
| 12 |
#include <assert.h> |
| 13 |
#include <math.h> |
| 14 |
#include <stddef.h> |
| 15 |
#include <stdint.h> |
| 16 |
|
| 17 |
extern void importFunc(); |
| 18 |
|
| 19 |
// Ignored function dtoh_verbose.foo because of linkage |
| 20 |
// Ignored variable dtoh_verbose.i because of linkage |
| 21 |
// Ignored function dtoh_verbose.bar because of linkage |
| 22 |
// Ignored struct dtoh_verbose.S because of linkage |
| 23 |
// Ignored class dtoh_verbose.C because of linkage |
| 24 |
// Ignored function dtoh_verbose.bar because it is extern |
| 25 |
// Ignored variable dtoh_verbose.i1 because of linkage |
| 26 |
// Ignored template dtoh_verbose.templ(T)(T t) because of linkage |
| 27 |
// Ignored alias dtoh_verbose.inst because of linkage |
| 28 |
// Ignored enum dtoh_verbose.arrayOpaque because of its base type |
| 29 |
// Ignored renamed import `myFunc = importFunc` because `using` only supports types |
| 30 |
struct A final |
| 31 |
{ |
| 32 |
// Ignored renamed import `myFunc = importFunc` because `using` only supports types |
| 33 |
A() |
| 34 |
{ |
| 35 |
} |
| 36 |
}; |
| 37 |
|
| 38 |
struct Hidden final |
| 39 |
{ |
| 40 |
// Ignored function dtoh_verbose.Hidden.hidden because it is private |
| 41 |
Hidden() |
| 42 |
{ |
| 43 |
} |
| 44 |
}; |
| 45 |
|
| 46 |
// Ignored alias dtoh_verbose.D because of linkage |
| 47 |
class Visitor |
| 48 |
{ |
| 49 |
public: |
| 50 |
virtual void stat(); |
| 51 |
// Ignored dtoh_verbose.Visitor.bar because `using` cannot rename functions in aggregates |
| 52 |
// Ignored dtoh_verbose.Visitor.unused because free functions cannot be aliased in C++ |
| 53 |
}; |
| 54 |
|
| 55 |
extern void unused(); |
| 56 |
|
| 57 |
// Ignored variable dtoh_verbose.and because its name is a special operator in C++ |
| 58 |
template <typename T> |
| 59 |
struct FullImportTmpl final |
| 60 |
{ |
| 61 |
// Ignored `dtoh_imports` because it's inside of a template declaration |
| 62 |
FullImportTmpl() |
| 63 |
{ |
| 64 |
} |
| 65 |
}; |
| 66 |
|
| 67 |
template <typename T> |
| 68 |
struct SelectiveImportsTmpl final |
| 69 |
{ |
| 70 |
// Ignored `__anonymous` because it's inside of a template declaration |
| 71 |
SelectiveImportsTmpl() |
| 72 |
{ |
| 73 |
} |
| 74 |
}; |
| 75 |
--- |
| 76 |
*/ |
| 77 |
|
| 78 |
void foo() {} |
| 79 |
|
| 80 |
extern (D) { |
| 81 |
int i; |
| 82 |
} |
| 83 |
|
| 84 |
void bar(); |
| 85 |
|
| 86 |
struct S {} |
| 87 |
|
| 88 |
class C {} |
| 89 |
|
| 90 |
extern(C++) void bar(); |
| 91 |
|
| 92 |
int i1; |
| 93 |
|
| 94 |
void templ(T)(T t) {} |
| 95 |
|
| 96 |
alias inst = templ!int; |
| 97 |
|
| 98 |
extern(C++) |
| 99 |
enum arrayOpaque : int[4]; |
| 100 |
|
| 101 |
public import dtoh_imports : myFunc = importFunc; |
| 102 |
|
| 103 |
extern(C++) struct A |
| 104 |
{ |
| 105 |
public import dtoh_imports : myFunc = importFunc; |
| 106 |
} |
| 107 |
|
| 108 |
extern(C++) struct Hidden |
| 109 |
{ |
| 110 |
private void hidden() {} |
| 111 |
} |
| 112 |
|
| 113 |
private { |
| 114 |
enum PI = 4; |
| 115 |
} |
| 116 |
|
| 117 |
alias D = size_t delegate (size_t x); |
| 118 |
|
| 119 |
extern(C++) T foo(T) = T.init; |
| 120 |
|
| 121 |
extern(C++) class Visitor |
| 122 |
{ |
| 123 |
void stat() {} |
| 124 |
|
| 125 |
// Ignored because those cannot be represented in C++ |
| 126 |
alias bar = stat; |
| 127 |
alias unused = .unused; |
| 128 |
} |
| 129 |
|
| 130 |
extern(C++) void unused() {} |
| 131 |
|
| 132 |
extern(C++) __gshared bool and; |
| 133 |
|
| 134 |
extern(C++) struct FullImportTmpl(T) |
| 135 |
{ |
| 136 |
public import dtoh_imports; |
| 137 |
|
| 138 |
} |
| 139 |
|
| 140 |
extern(C++) struct SelectiveImportsTmpl(T) |
| 141 |
{ |
| 142 |
public import dtoh_imports : |
| 143 |
importFunc, |
| 144 |
aliasName = ImportsC; |
| 145 |
} |