Skip to content

Commit 27fe7b0

Browse files
Move extra header files into TEST_OUTPUT
1 parent 4f1cf18 commit 27fe7b0

19 files changed

Lines changed: 538 additions & 568 deletions

test/compilable/dtoh_AliasDeclaration.d

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,69 @@
1-
// REQUIRED_ARGS: -HCf=${RESULTS_DIR}/compilable/dtoh_AliasDeclaration.h -c
2-
// PERMUTE_ARGS:
3-
// POST_SCRIPT: compilable/extra-files/dtoh-postscript.sh
4-
51
/*
2+
REQUIRED_ARGS: -HC -c -o-
3+
PERMUTE_ARGS:
64
TEST_OUTPUT:
75
---
6+
#pragma once
7+
8+
// Automatically generated by dmd -HC
9+
10+
#include <assert.h>
11+
#include <stddef.h>
12+
#include <stdio.h>
13+
#include <string.h>
14+
15+
#define _d_void void
16+
#define _d_bool bool
17+
#define _d_byte signed char
18+
#define _d_ubyte unsigned char
19+
#define _d_short short
20+
#define _d_ushort unsigned short
21+
#define _d_int int
22+
#define _d_uint unsigned
23+
#define _d_long $?:32=long long|64=long$
24+
#define _d_ulong unsigned $?:32=long long|64=long$
25+
#define _d_float float
26+
#define _d_double double
27+
#define _d_real long double
28+
#define _d_char char
29+
#define _d_wchar wchar_t
30+
#define _d_dchar unsigned
31+
typedef _d_long d_int64;
32+
33+
#define _d_null NULL
34+
35+
36+
// Parsing module dtoh_AliasDeclaration
37+
struct S;
38+
struct S2;
39+
class C;
40+
class C2;
41+
typedef _d_int T;
42+
43+
extern "C" _d_int x;
44+
45+
// ignored variable dtoh_AliasDeclaration.x
46+
extern "C" _d_int foo(_d_int x);
47+
48+
// ignored function dtoh_AliasDeclaration.foo
49+
extern _d_int foo2(_d_int x);
50+
51+
// ignored function dtoh_AliasDeclaration.foo2
52+
struct S;
53+
54+
typedef S aliasS;
55+
56+
struct S2;
57+
58+
typedef S2 aliasS2;
59+
60+
// ignoring non-cpp class C
61+
typedef C* aliasC;
62+
63+
class C2;
64+
65+
typedef C2* aliasC2;
66+
867
---
968
*/
1069

test/compilable/dtoh_AnonDeclaration.d

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,55 @@
1-
// REQUIRED_ARGS: -HCf=${RESULTS_DIR}/compilable/dtoh_AnonDeclaration.h -c
2-
// PERMUTE_ARGS:
3-
// POST_SCRIPT: compilable/extra-files/dtoh-postscript.sh
4-
51
/*
2+
REQUIRED_ARGS: -HC -c -o-
3+
PERMUTE_ARGS:
64
TEST_OUTPUT:
75
---
6+
#pragma once
7+
8+
// Automatically generated by dmd -HC
9+
10+
#include <assert.h>
11+
#include <stddef.h>
12+
#include <stdio.h>
13+
#include <string.h>
14+
15+
#define _d_void void
16+
#define _d_bool bool
17+
#define _d_byte signed char
18+
#define _d_ubyte unsigned char
19+
#define _d_short short
20+
#define _d_ushort unsigned short
21+
#define _d_int int
22+
#define _d_uint unsigned
23+
#define _d_long $?:32=long long|64=long$
24+
#define _d_ulong unsigned $?:32=long long|64=long$
25+
#define _d_float float
26+
#define _d_double double
27+
#define _d_real long double
28+
#define _d_char char
29+
#define _d_wchar wchar_t
30+
#define _d_dchar unsigned
31+
typedef _d_long d_int64;
32+
33+
#define _d_null NULL
34+
35+
36+
// Parsing module dtoh_AnonDeclaration
37+
struct S
38+
{
39+
union
40+
{
41+
_d_int x;
42+
_d_char c[4$?:32=u|64=LLU$];
43+
};
44+
struct
45+
{
46+
_d_int y;
47+
_d_double z;
48+
extern "C" _d_void foo();
49+
_d_void bar();
50+
};
51+
S() {}
52+
};
853
---
954
*/
1055

test/compilable/dtoh_ClassDeclaration.d

Lines changed: 104 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,110 @@
1-
// REQUIRED_ARGS: -HCf=${RESULTS_DIR}/compilable/dtoh_ClassDeclaration.h -c
2-
// PERMUTE_ARGS:
3-
// POST_SCRIPT: compilable/extra-files/dtoh-postscript.sh
4-
51
/*
2+
REQUIRED_ARGS: -HC -c -o-
3+
PERMUTE_ARGS:
64
TEST_OUTPUT:
75
---
6+
#pragma once
7+
8+
// Automatically generated by dmd -HC
9+
10+
#include <assert.h>
11+
#include <stddef.h>
12+
#include <stdio.h>
13+
#include <string.h>
14+
15+
#define _d_void void
16+
#define _d_bool bool
17+
#define _d_byte signed char
18+
#define _d_ubyte unsigned char
19+
#define _d_short short
20+
#define _d_ushort unsigned short
21+
#define _d_int int
22+
#define _d_uint unsigned
23+
#define _d_long $?:32=long long|64=long$
24+
#define _d_ulong unsigned $?:32=long long|64=long$
25+
#define _d_float float
26+
#define _d_double double
27+
#define _d_real long double
28+
#define _d_char char
29+
#define _d_wchar wchar_t
30+
#define _d_dchar unsigned
31+
typedef _d_long d_int64;
32+
33+
#define _d_null NULL
34+
35+
36+
// Parsing module dtoh_ClassDeclaration
37+
class C;
38+
class A;
39+
struct Inner;
40+
class C
41+
{
42+
public:
43+
_d_byte a;
44+
_d_int b;
45+
_d_long c;
46+
};
47+
48+
class C2
49+
{
50+
public:
51+
_d_int a;
52+
_d_int b;
53+
_d_long c;
54+
C2(_d_int a);
55+
};
56+
57+
// ignoring non-cpp class C3
58+
class Aligned
59+
{
60+
public:
61+
_d_byte a;
62+
_d_int b;
63+
_d_long c;
64+
Aligned(_d_int a);
65+
};
66+
67+
class A
68+
{
69+
public:
70+
_d_int a;
71+
C* c;
72+
virtual _d_void foo();
73+
extern "C" virtual _d_void bar();
74+
virtual _d_void baz(_d_int x = 42);
75+
struct
76+
{
77+
_d_int x;
78+
_d_int y;
79+
};
80+
union
81+
{
82+
_d_int u1;
83+
_d_char u2[4$?:32=u|64=LLU$];
84+
};
85+
struct Inner
86+
{
87+
_d_int x;
88+
Inner() : x() {}
89+
};
90+
91+
class InnerC
92+
{
93+
public:
94+
_d_int x;
95+
};
96+
97+
class NonStaticInnerC
98+
{
99+
public:
100+
_d_int x;
101+
A* this;
102+
};
103+
104+
typedef Inner I;
105+
class CC;
106+
107+
};
8108
---
9109
*/
10110

test/compilable/dtoh_StructDeclaration.d

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,115 @@
1-
// REQUIRED_ARGS: -HCf=${RESULTS_DIR}/compilable/dtoh_StructDeclaration.h -c
2-
// PERMUTE_ARGS:
3-
// POST_SCRIPT: compilable/extra-files/dtoh-postscript.sh
4-
51
/*
2+
REQUIRED_ARGS: -HC -c -o-
3+
PERMUTE_ARGS:
64
TEST_OUTPUT:
75
---
6+
#pragma once
7+
8+
// Automatically generated by dmd -HC
9+
10+
#include <assert.h>
11+
#include <stddef.h>
12+
#include <stdio.h>
13+
#include <string.h>
14+
15+
#define _d_void void
16+
#define _d_bool bool
17+
#define _d_byte signed char
18+
#define _d_ubyte unsigned char
19+
#define _d_short short
20+
#define _d_ushort unsigned short
21+
#define _d_int int
22+
#define _d_uint unsigned
23+
#define _d_long $?:32=long long|64=long$
24+
#define _d_ulong unsigned $?:32=long long|64=long$
25+
#define _d_float float
26+
#define _d_double double
27+
#define _d_real long double
28+
#define _d_char char
29+
#define _d_wchar wchar_t
30+
#define _d_dchar unsigned
31+
typedef _d_long d_int64;
32+
33+
#define _d_null NULL
34+
35+
36+
// Parsing module dtoh_StructDeclaration
37+
struct S;
38+
struct Inner;
39+
struct S
40+
{
41+
_d_byte a;
42+
_d_int b;
43+
_d_long c;
44+
S() : a(), b(), c() {}
45+
};
46+
47+
struct S2
48+
{
49+
_d_int a;
50+
_d_int b;
51+
_d_long c;
52+
S2(_d_int a);
53+
S2() : a(42), b(), c() {}
54+
};
55+
56+
struct S3
57+
{
58+
_d_int a;
59+
_d_int b;
60+
_d_long c;
61+
extern "C" S3(_d_int a);
62+
S3() : a(42), b(), c() {}
63+
};
64+
65+
struct
66+
#if defined(__GNUC__) || defined(__clang__)
67+
__attribute__((packed, aligned(1)))
68+
#elif defined(_MSC_VER)
69+
__declspec(align(1))
70+
#elif defined(__DMC__)
71+
#pragma pack(push, 1)
72+
#endif
73+
Aligned
74+
{
75+
_d_byte a;
76+
_d_int b;
77+
_d_long c;
78+
Aligned(_d_int a);
79+
Aligned() : a(), b(), c() {}
80+
};
81+
#if defined(__DMC__)
82+
#pragma pack(pop)
83+
#endif
84+
85+
struct A
86+
{
87+
_d_int a;
88+
S s;
89+
// ignoring extern () block because of linkage
90+
extern "C" _d_void bar();
91+
_d_void baz(_d_int x = 42);
92+
struct
93+
{
94+
_d_int x;
95+
_d_int y;
96+
};
97+
union
98+
{
99+
_d_int u1;
100+
_d_char u2[4$?:32=u|64=LLU$];
101+
};
102+
struct Inner
103+
{
104+
_d_int x;
105+
Inner() : x() {}
106+
};
107+
108+
typedef Inner I;
109+
class C;
110+
111+
A() : a(), s() {}
112+
};
8113
---
9114
*/
10115

0 commit comments

Comments
 (0)