From a94ad9e89c8e9f1ca11ca194f690460725676b3b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 29 Jan 2016 02:17:51 -0700 Subject: parseh defines can reference other defines --- test/run_tests.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/run_tests.cpp') 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) { -- cgit v1.2.3