Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cbindgen
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dan Robertson
cbindgen
Commits
34671d9a
Commit
34671d9a
authored
Mar 11, 2018
by
Johan Anderholm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify test to run all three styles for C.
parent
35fa1b54
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
1541 additions
and
14 deletions
+1541
-14
test.py
test.py
+16
-11
alias.c
tests/expectations/both/alias.c
+36
-0
annotation.c
tests/expectations/both/annotation.c
+20
-0
cdecl.c
tests/expectations/both/cdecl.c
+35
-0
cfg-2.c
tests/expectations/both/cfg-2.c
+27
-0
cfg-field.c
tests/expectations/both/cfg-field.c
+3
-0
cfg.c
tests/expectations/both/cfg.c
+45
-0
constant.c
tests/expectations/both/constant.c
+13
-0
display_list.c
tests/expectations/both/display_list.c
+44
-0
enum.c
tests/expectations/both/enum.c
+122
-0
euclid.c
tests/expectations/both/euclid.c
+116
-0
expand.c
tests/expectations/both/expand.c
+9
-0
extern-2.c
tests/expectations/both/extern-2.c
+7
-0
extern.c
tests/expectations/both/extern.c
+12
-0
include.c
tests/expectations/both/include.c
+4
-0
include_item.c
tests/expectations/both/include_item.c
+12
-0
inner_mod.c
tests/expectations/both/inner_mod.c
+9
-0
monomorph-1.c
tests/expectations/both/monomorph-1.c
+42
-0
monomorph-2.c
tests/expectations/both/monomorph-2.c
+21
-0
monomorph-3.c
tests/expectations/both/monomorph-3.c
+42
-0
rename.c
tests/expectations/both/rename.c
+31
-0
simplify-option-ptr.c
tests/expectations/both/simplify-option-ptr.c
+19
-0
static.c
tests/expectations/both/static.c
+17
-0
std_lib.c
tests/expectations/both/std_lib.c
+11
-0
struct.c
tests/expectations/both/struct.c
+27
-0
typedef.c
tests/expectations/both/typedef.c
+12
-0
union.c
tests/expectations/both/union.c
+17
-0
monomorph-2.c
tests/expectations/monomorph-2.c
+2
-2
monomorph-2.cpp
tests/expectations/monomorph-2.cpp
+1
-1
alias.c
tests/expectations/tag/alias.c
+36
-0
annotation.c
tests/expectations/tag/annotation.c
+20
-0
cdecl.c
tests/expectations/tag/cdecl.c
+35
-0
cfg-2.c
tests/expectations/tag/cfg-2.c
+27
-0
cfg-field.c
tests/expectations/tag/cfg-field.c
+3
-0
cfg.c
tests/expectations/tag/cfg.c
+45
-0
constant.c
tests/expectations/tag/constant.c
+13
-0
display_list.c
tests/expectations/tag/display_list.c
+44
-0
enum.c
tests/expectations/tag/enum.c
+132
-0
euclid.c
tests/expectations/tag/euclid.c
+116
-0
expand.c
tests/expectations/tag/expand.c
+9
-0
extern-2.c
tests/expectations/tag/extern-2.c
+7
-0
extern.c
tests/expectations/tag/extern.c
+12
-0
include.c
tests/expectations/tag/include.c
+4
-0
include_item.c
tests/expectations/tag/include_item.c
+12
-0
inner_mod.c
tests/expectations/tag/inner_mod.c
+9
-0
monomorph-1.c
tests/expectations/tag/monomorph-1.c
+42
-0
monomorph-2.c
tests/expectations/tag/monomorph-2.c
+21
-0
monomorph-3.c
tests/expectations/tag/monomorph-3.c
+42
-0
rename.c
tests/expectations/tag/rename.c
+31
-0
simplify-option-ptr.c
tests/expectations/tag/simplify-option-ptr.c
+19
-0
static.c
tests/expectations/tag/static.c
+17
-0
std_lib.c
tests/expectations/tag/std_lib.c
+13
-0
struct.c
tests/expectations/tag/struct.c
+31
-0
typedef.c
tests/expectations/tag/typedef.c
+12
-0
union.c
tests/expectations/tag/union.c
+17
-0
No files found.
test.py
View file @
34671d9a
...
...
@@ -13,7 +13,7 @@ def build_cbindgen():
except
subprocess
.
CalledProcessError
:
return
False
def
cbindgen
(
path
,
out
,
c
):
def
cbindgen
(
path
,
out
,
c
,
style
):
bin
=
[
"cargo"
,
"run"
,
"--"
]
compile
=
[
path
,
"-o"
,
out
]
flags
=
[]
...
...
@@ -21,6 +21,9 @@ def cbindgen(path, out, c):
if
c
:
flags
+=
[
"--lang"
,
"c"
]
if
style
:
flags
+=
[
"--style"
,
style
]
config
=
path
.
replace
(
".rs"
,
".toml"
)
if
not
os
.
path
.
isdir
(
path
)
and
os
.
path
.
exists
(
config
):
flags
+=
[
"--config"
,
config
]
...
...
@@ -45,7 +48,7 @@ def gxx(src):
subprocess
.
check_output
([
gxx_bin
,
"-D"
,
"DEFINED"
,
"-std=c++11"
,
"-c"
,
src
,
"-o"
,
"tests/expectations/tmp.o"
])
os
.
remove
(
"tests/expectations/tmp.o"
)
def
run_compile_test
(
rust_src
,
should_verify
,
c
):
def
run_compile_test
(
rust_src
,
should_verify
,
c
,
style
=
""
):
is_crate
=
os
.
path
.
isdir
(
rust_src
)
test_name
=
rust_src
...
...
@@ -59,7 +62,8 @@ def run_compile_test(rust_src, should_verify, c):
expectation
=
False
if
c
:
out
=
os
.
path
.
join
(
'tests/expectations/'
,
test_name
+
".c"
)
subdir
=
style
if
style
!=
"type"
else
""
out
=
os
.
path
.
join
(
'tests/expectations/'
,
subdir
,
test_name
+
".c"
)
verify
=
'tests/expectations/__verify__.c'
else
:
out
=
os
.
path
.
join
(
'tests/expectations/'
,
test_name
+
".cpp"
)
...
...
@@ -67,7 +71,7 @@ def run_compile_test(rust_src, should_verify, c):
try
:
if
should_verify
:
cbindgen
(
rust_src
,
verify
,
c
)
cbindgen
(
rust_src
,
verify
,
c
,
style
)
if
c
:
gcc
(
verify
)
...
...
@@ -79,7 +83,7 @@ def run_compile_test(rust_src, should_verify, c):
return
False
os
.
remove
(
verify
)
else
:
cbindgen
(
rust_src
,
out
,
c
)
cbindgen
(
rust_src
,
out
,
c
,
style
)
if
c
:
gcc
(
out
)
...
...
@@ -118,12 +122,13 @@ num_fail = 0
# C
for
test
in
tests
:
if
run_compile_test
(
test
,
should_verify
,
True
):
num_pass
+=
1
print
(
"Pass -
%
s"
%
test
)
else
:
num_fail
+=
1
print
(
"Fail -
%
s"
%
test
)
for
style
in
[
"type"
,
"tag"
,
"both"
]:
if
run_compile_test
(
test
,
should_verify
,
True
,
style
):
num_pass
+=
1
print
(
"Pass -
%
s"
%
test
)
else
:
num_fail
+=
1
print
(
"Fail -
%
s"
%
test
)
# C++
...
...
tests/expectations/both/alias.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
enum
Status
{
Ok
,
Err
,
};
typedef
uint32_t
Status
;
typedef
struct
Dep
{
int32_t
a
;
float
b
;
}
Dep
;
typedef
struct
Foo_i32
{
int32_t
a
;
int32_t
b
;
Dep
c
;
}
Foo_i32
;
typedef
Foo_i32
IntFoo
;
typedef
struct
Foo_f64
{
double
a
;
double
b
;
Dep
c
;
}
Foo_f64
;
typedef
Foo_f64
DoubleFoo
;
typedef
int32_t
Unit
;
typedef
Status
SpecialStatus
;
void
root
(
IntFoo
x
,
DoubleFoo
y
,
Unit
z
,
SpecialStatus
w
);
tests/expectations/both/annotation.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
enum
C
{
X
=
2
,
Y
,
};
typedef
uint32_t
C
;
typedef
struct
A
{
int32_t
m0
;
}
A
;
typedef
struct
B
{
int32_t
x
;
float
y
;
}
B
;
void
root
(
A
x
,
B
y
,
C
z
);
tests/expectations/both/cdecl.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
void
(
*
A
)();
typedef
void
(
*
B
)();
typedef
bool
(
*
C
)(
int32_t
,
int32_t
);
typedef
bool
(
*
(
*
D
)(
int32_t
))(
float
);
typedef
int32_t
(
*
(
*
E
)())[
16
];
typedef
const
int32_t
*
F
;
typedef
const
int32_t
*
const
*
G
;
typedef
int32_t
*
const
*
H
;
typedef
int32_t
(
*
I
)[
16
];
typedef
double
(
**
J
)(
float
);
typedef
int32_t
K
[
16
];
typedef
const
int32_t
*
L
[
16
];
typedef
bool
(
*
M
[
16
])(
int32_t
,
int32_t
);
typedef
void
(
*
N
[
16
])(
int32_t
,
int32_t
);
void
(
*
O
(
void
))(
void
);
void
root
(
A
a
,
B
b
,
C
c
,
D
d
,
E
e
,
F
f
,
G
g
,
H
h
,
I
i
,
J
j
,
K
k
,
L
l
,
M
m
,
N
n
);
tests/expectations/both/cfg-2.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#if (defined(NOT_DEFINED) || defined(DEFINED))
typedef
struct
Foo
{
int32_t
x
;
}
Foo
;
#endif
#if defined(NOT_DEFINED)
typedef
struct
Bar
{
Foo
y
;
}
Bar
;
#endif
#if defined(DEFINED)
typedef
struct
Bar
{
Foo
z
;
}
Bar
;
#endif
typedef
struct
Root
{
Bar
w
;
}
Root
;
void
root
(
Root
a
);
tests/expectations/both/cfg-field.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
tests/expectations/both/cfg.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#if (defined(PLATFORM_WIN) || defined(M_32))
enum
BarType
{
A
,
B
,
C
,
};
typedef
uint32_t
BarType
;
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
enum
FooType
{
A
,
B
,
C
,
};
typedef
uint32_t
FooType
;
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
typedef
struct
FooHandle
{
FooType
ty
;
int32_t
x
;
float
y
;
}
FooHandle
;
#endif
#if (defined(PLATFORM_WIN) || defined(M_32))
typedef
struct
BarHandle
{
BarType
ty
;
int32_t
x
;
float
y
;
}
BarHandle
;
#endif
#if (defined(PLATFORM_UNIX) && defined(X11))
void
root
(
FooHandle
a
);
#endif
#if (defined(PLATFORM_WIN) || defined(M_32))
void
root
(
BarHandle
a
);
#endif
tests/expectations/both/constant.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#define FOO 10
#define ZOM 3.14
typedef
struct
Foo
{
int32_t
x
[
FOO
];
}
Foo
;
void
root
(
Foo
x
);
tests/expectations/both/display_list.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
Rect
{
float
x
;
float
y
;
float
w
;
float
h
;
}
Rect
;
typedef
struct
Color
{
uint8_t
r
;
uint8_t
g
;
uint8_t
b
;
uint8_t
a
;
}
Color
;
enum
DisplayItem_Tag
{
Fill
,
Image
,
ClearScreen
,
};
typedef
uint8_t
DisplayItem_Tag
;
typedef
struct
Fill_Body
{
DisplayItem_Tag
tag
;
Rect
_0
;
Color
_1
;
}
Fill_Body
;
typedef
struct
Image_Body
{
DisplayItem_Tag
tag
;
uint32_t
id
;
Rect
bounds
;
}
Image_Body
;
typedef
union
DisplayItem
{
DisplayItem_Tag
tag
;
Fill_Body
fill
;
Image_Body
image
;
}
DisplayItem
;
bool
push_item
(
DisplayItem
item
);
tests/expectations/both/enum.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
enum
A
{
a1
=
0
,
a2
=
2
,
a3
,
a4
=
5
,
};
typedef
uint32_t
A
;
enum
B
{
b1
=
0
,
b2
=
2
,
b3
,
b4
=
5
,
};
typedef
uint16_t
B
;
enum
C
{
c1
=
0
,
c2
=
2
,
c3
,
c4
=
5
,
};
typedef
uint8_t
C
;
enum
D
{
d1
=
0
,
d2
=
2
,
d3
,
d4
=
5
,
};
typedef
uintptr_t
D
;
enum
E
{
e1
=
0
,
e2
=
2
,
e3
,
e4
=
5
,
};
typedef
intptr_t
E
;
typedef
struct
I
I
;
typedef
struct
J
J
;
typedef
struct
Opaque
Opaque
;
enum
F_Tag
{
Foo
,
Bar
,
Baz
,
};
typedef
uint8_t
F_Tag
;
typedef
struct
Foo_Body
{
F_Tag
tag
;
int16_t
_0
;
}
Foo_Body
;
typedef
struct
Bar_Body
{
F_Tag
tag
;
uint8_t
x
;
int16_t
y
;
}
Bar_Body
;
typedef
union
F
{
F_Tag
tag
;
Foo_Body
foo
;
Bar_Body
bar
;
}
F
;
typedef
enum
G_Tag
{
G_Foo
,
G_Bar
,
G_Baz
,
}
G_Tag
;
typedef
struct
G_Foo_Body
{
int16_t
_0
;
}
G_Foo_Body
;
typedef
struct
G_Bar_Body
{
uint8_t
x
;
int16_t
y
;
}
G_Bar_Body
;
typedef
struct
G
{
G_Tag
tag
;
union
{
G_Foo_Body
foo
;
G_Bar_Body
bar
;
};
}
G
;
enum
H_Tag
{
H_Foo
,
H_Bar
,
H_Baz
,
};
typedef
uint8_t
H_Tag
;
typedef
struct
H_Foo_Body
{
int16_t
_0
;
}
H_Foo_Body
;
typedef
struct
H_Bar_Body
{
uint8_t
x
;
int16_t
y
;
}
H_Bar_Body
;
typedef
struct
H
{
H_Tag
tag
;
union
{
H_Foo_Body
foo
;
H_Bar_Body
bar
;
};
}
H
;
void
root
(
Opaque
*
o
,
A
a
,
B
b
,
C
c
,
D
d
,
E
e
,
F
f
,
G
g
,
H
h
,
I
i
,
J
j
);
tests/expectations/both/euclid.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
TypedLength_f32__UnknownUnit
{
float
_0
;
}
TypedLength_f32__UnknownUnit
;
typedef
struct
TypedLength_f32__LayoutUnit
{
float
_0
;
}
TypedLength_f32__LayoutUnit
;
typedef
TypedLength_f32__UnknownUnit
Length_f32
;
typedef
TypedLength_f32__LayoutUnit
LayoutLength
;
typedef
struct
TypedSideOffsets2D_f32__UnknownUnit
{
float
top
;
float
right
;
float
bottom
;
float
left
;
}
TypedSideOffsets2D_f32__UnknownUnit
;
typedef
struct
TypedSideOffsets2D_f32__LayoutUnit
{
float
top
;
float
right
;
float
bottom
;
float
left
;
}
TypedSideOffsets2D_f32__LayoutUnit
;
typedef
TypedSideOffsets2D_f32__UnknownUnit
SideOffsets2D_f32
;
typedef
TypedSideOffsets2D_f32__LayoutUnit
LayoutSideOffsets2D
;
typedef
struct
TypedSize2D_f32__UnknownUnit
{
float
width
;
float
height
;
}
TypedSize2D_f32__UnknownUnit
;
typedef
struct
TypedSize2D_f32__LayoutUnit
{
float
width
;
float
height
;
}
TypedSize2D_f32__LayoutUnit
;
typedef
TypedSize2D_f32__UnknownUnit
Size2D_f32
;
typedef
TypedSize2D_f32__LayoutUnit
LayoutSize2D
;
typedef
struct
TypedPoint2D_f32__UnknownUnit
{
float
x
;
float
y
;
}
TypedPoint2D_f32__UnknownUnit
;
typedef
struct
TypedPoint2D_f32__LayoutUnit
{
float
x
;
float
y
;
}
TypedPoint2D_f32__LayoutUnit
;
typedef
TypedPoint2D_f32__UnknownUnit
Point2D_f32
;
typedef
TypedPoint2D_f32__LayoutUnit
LayoutPoint2D
;
typedef
struct
TypedRect_f32__UnknownUnit
{
TypedPoint2D_f32__UnknownUnit
origin
;
TypedSize2D_f32__UnknownUnit
size
;
}
TypedRect_f32__UnknownUnit
;
typedef
struct
TypedRect_f32__LayoutUnit
{
TypedPoint2D_f32__LayoutUnit
origin
;
TypedSize2D_f32__LayoutUnit
size
;
}
TypedRect_f32__LayoutUnit
;
typedef
TypedRect_f32__UnknownUnit
Rect_f32
;
typedef
TypedRect_f32__LayoutUnit
LayoutRect
;
typedef
struct
TypedTransform2D_f32__UnknownUnit__LayoutUnit
{
float
m11
;
float
m12
;
float
m21
;
float
m22
;
float
m31
;
float
m32
;
}
TypedTransform2D_f32__UnknownUnit__LayoutUnit
;
typedef
struct
TypedTransform2D_f32__LayoutUnit__UnknownUnit
{
float
m11
;
float
m12
;
float
m21
;
float
m22
;
float
m31
;
float
m32
;
}
TypedTransform2D_f32__LayoutUnit__UnknownUnit
;
void
root
(
TypedLength_f32__UnknownUnit
length_a
,
TypedLength_f32__LayoutUnit
length_b
,
Length_f32
length_c
,
LayoutLength
length_d
,
TypedSideOffsets2D_f32__UnknownUnit
side_offsets_a
,
TypedSideOffsets2D_f32__LayoutUnit
side_offsets_b
,
SideOffsets2D_f32
side_offsets_c
,
LayoutSideOffsets2D
side_offsets_d
,
TypedSize2D_f32__UnknownUnit
size_a
,
TypedSize2D_f32__LayoutUnit
size_b
,
Size2D_f32
size_c
,
LayoutSize2D
size_d
,
TypedPoint2D_f32__UnknownUnit
point_a
,
TypedPoint2D_f32__LayoutUnit
point_b
,
Point2D_f32
point_c
,
LayoutPoint2D
point_d
,
TypedRect_f32__UnknownUnit
rect_a
,
TypedRect_f32__LayoutUnit
rect_b
,
Rect_f32
rect_c
,
LayoutRect
rect_d
,
TypedTransform2D_f32__UnknownUnit__LayoutUnit
transform_a
,
TypedTransform2D_f32__LayoutUnit__UnknownUnit
transform_b
);
tests/expectations/both/expand.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
Foo
{
}
Foo
;
void
root
(
Foo
a
);
tests/expectations/both/extern-2.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
void
first
(
void
);
void
second
(
void
);
tests/expectations/both/extern.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
Normal
{
int32_t
x
;
float
y
;
}
Normal
;
extern
void
bar
(
Normal
a
);
extern
int32_t
foo
(
void
);
tests/expectations/both/include.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
tests/expectations/both/include_item.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
A
{
int32_t
x
;
float
y
;
}
A
;
typedef
struct
B
{
A
data
;
}
B
;
tests/expectations/both/inner_mod.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
Foo
{
float
x
;
}
Foo
;
void
root
(
Foo
a
);
tests/expectations/both/monomorph-1.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
Bar_Bar_f32
Bar_Bar_f32
;
typedef
struct
Bar_Foo_f32
Bar_Foo_f32
;
typedef
struct
Bar_f32
Bar_f32
;
typedef
struct
Foo_i32
{
const
int32_t
*
data
;
}
Foo_i32
;
typedef
struct
Foo_f32
{
const
float
*
data
;
}
Foo_f32
;
typedef
struct
Foo_Bar_f32
{
const
Bar_f32
*
data
;
}
Foo_Bar_f32
;
typedef
struct
Tuple_Foo_f32_____f32
{
const
Foo_f32
*
a
;
const
float
*
b
;
}
Tuple_Foo_f32_____f32
;
typedef
struct
Tuple_f32__f32
{
const
float
*
a
;
const
float
*
b
;
}
Tuple_f32__f32
;
typedef
Tuple_f32__f32
Indirection_f32
;
void
root
(
Foo_i32
a
,
Foo_f32
b
,
Bar_f32
c
,
Foo_Bar_f32
d
,
Bar_Foo_f32
e
,
Bar_Bar_f32
f
,
Tuple_Foo_f32_____f32
g
,
Indirection_f32
h
);
tests/expectations/both/monomorph-2.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
A
A
;
typedef
struct
B
B
;
typedef
struct
List_B
{
B
*
members
;
uintptr_t
count
;
}
List_B
;
typedef
struct
List_A
{
A
*
members
;
uintptr_t
count
;
}
List_A
;
void
bar
(
List_B
b
);
void
foo
(
List_A
a
);
tests/expectations/both/monomorph-3.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
typedef
struct
Bar_Bar_f32
Bar_Bar_f32
;
typedef
struct
Bar_Foo_f32
Bar_Foo_f32
;
typedef
struct
Bar_f32
Bar_f32
;
typedef
union
Foo_i32
{
const
int32_t
*
data
;
}
Foo_i32
;
typedef
union
Foo_f32
{
const
float
*
data
;
}
Foo_f32
;
typedef
union
Foo_Bar_f32
{
const
Bar_f32
*
data
;
}
Foo_Bar_f32
;
typedef
union
Tuple_Foo_f32_____f32
{
const
Foo_f32
*
a
;
const
float
*
b
;
}
Tuple_Foo_f32_____f32
;
typedef
union
Tuple_f32__f32
{
const
float
*
a
;
const
float
*
b
;
}
Tuple_f32__f32
;
typedef
Tuple_f32__f32
Indirection_f32
;
void
root
(
Foo_i32
a
,
Foo_f32
b
,
Bar_f32
c
,
Foo_Bar_f32
d
,
Bar_Foo_f32
e
,
Bar_Bar_f32
f
,
Tuple_Foo_f32_____f32
g
,
Indirection_f32
h
);
tests/expectations/both/rename.c
0 → 100644
View file @
34671d9a
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#define C_H 10
enum
C_E
{
x
=
0
,
y
=
1
,
};
typedef
uint8_t
C_E
;
typedef
struct
C_A
C_A
;