aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-02-01 00:01:30 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-02-01 00:01:30 -0700
commit6b2e29c6ac58d5f4370828bfa0f54b83d1931a97 (patch)
tree9d562684b949af519f5013234b910a1a0fd23a02 /test/run_tests.cpp
parentc1b5518a65acd646c23e763a57c9eb78e533d61a (diff)
downloadzig-6b2e29c6ac58d5f4370828bfa0f54b83d1931a97.tar.gz
zig-6b2e29c6ac58d5f4370828bfa0f54b83d1931a97.zip
parseh: do not create macro alias for extern vars
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 5d61da6cd1..89a6a9bee9 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -2108,6 +2108,19 @@ Foo fun(Foo *a);
"pub type c_void = u8;",
"pub const Foo = c_void;",
"pub extern fn fun(a: ?&c_void);");
+
+ add_parseh_case("ignore #define for non-const", R"SOURCE(
+struct Foo {
+ int x;
+};
+extern void (*fn_ptr)(void);
+#define Foo fn_ptr
+ )SOURCE", 3,
+ "pub type c_void = u8;",
+ "pub const Foo = struct_Foo;",
+ R"OUTPUT(export struct struct_Foo {
+ x: c_int,
+})OUTPUT");
}
static void print_compiler_invocation(TestCase *test_case) {