aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-29 02:17:51 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-29 02:17:51 -0700
commita94ad9e89c8e9f1ca11ca194f690460725676b3b (patch)
tree82459f85308b8fc50790b35ad2a5bcd6a1ff2388 /test/run_tests.cpp
parentc1691afdd90b744200f2238afe52d7fd9e6471b6 (diff)
downloadzig-a94ad9e89c8e9f1ca11ca194f690460725676b3b.tar.gz
zig-a94ad9e89c8e9f1ca11ca194f690460725676b3b.zip
parseh defines can reference other defines
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 6cc33f1536..ba991b163f 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1998,10 +1998,19 @@ pub extern fn some_func(foo: ?&struct_Foo, x: c_int) -> ?&struct_Foo;)OUTPUT",
#define CHANNEL_COUNT 24
)SOURCE", 1, R"OUTPUT(pub const CHANNEL_COUNT = 24;)OUTPUT");
+
add_parseh_case("overide previous #define", R"SOURCE(
#define A_CHAR 'a'
#define A_CHAR 'b'
)SOURCE", 1, "pub const A_CHAR = 'b';");
+
+
+ add_parseh_case("#define referencing another #define", R"SOURCE(
+#define THING2 THING1
+#define THING1 1234
+ )SOURCE", 2,
+ "pub const THING1 = 1234;",
+ "pub const THING2 = THING1;");
}
static void print_compiler_invocation(TestCase *test_case) {