Skip to content

[libc] newheadergen: quick fixes to tests #98561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libc/newhdrgen/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def __str__(self):
content.append("")
for object in self.objects:
content.append(str(object))
content.append("__END_C_DECLS")
if self.objects:
content.append("\n__END_C_DECLS")
else:
content.append("__END_C_DECLS")

return "\n".join(content)
4 changes: 2 additions & 2 deletions libc/newhdrgen/tests/expected_output/test_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ enum {
__BEGIN_C_DECLS

#ifdef FUNC_A_16
void func_a()CONST_FUNC_A;
CONST_FUNC_A void func_a() __NOEXCEPT;
#endif // FUNC_A_16

#ifdef FUNC_B_16
int func_b(int, float)CONST_FUNC_B;
CONST_FUNC_B int func_b(int, float) __NOEXCEPT;
#endif // FUNC_B_16

extern obj object_1;
Expand Down
6 changes: 4 additions & 2 deletions libc/newhdrgen/tests/input/test_small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ functions:
standards:
- stdc
guard: FUNC_A_16
attributes: CONST_FUNC_A
attributes:
- CONST_FUNC_A
- name: func_b
return_type: int
arguments:
Expand All @@ -33,4 +34,5 @@ functions:
standards:
- stdc
guard: FUNC_B_16
attributes: CONST_FUNC_B
attributes:
- CONST_FUNC_B
Loading