Skip to content

Commit

Permalink
Add tests for issue 320
Browse files Browse the repository at this point in the history
  • Loading branch information
melonedo committed Sep 13, 2021
1 parent 9c9fea5 commit e5bff19
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ include("rewriter.jl")
# print
@test_logs (:info, "Done!") match_mode=:any build!(ctx, BUILDSTAGE_PRINTING_ONLY)
end

@testset "Issue 320" begin
args = get_default_args()
dir = joinpath(@__DIR__, "sys")
push!(args, "-isystem$dir")
headers = [joinpath(@__DIR__, "include", "test.h")]
ctx = create_context(headers, args)
@add_def stat
@test build!(ctx, BUILDSTAGE_NO_PRINTING) isa Any
end
7 changes: 7 additions & 0 deletions test/include/test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef TEST
#define TEST
#include "system.h"

typedef struct stat mystat;

#endif /* TEST */
6 changes: 6 additions & 0 deletions test/sys/system.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef SYSTEM
#define SYSTEM
void stat(void);
struct stat {};

#endif /* SYSTEM */

0 comments on commit e5bff19

Please sign in to comment.