aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-04-22 15:24:18 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-04-22 15:24:18 -0700
commit8187396f640d2a56e0d56c7d199074b4590e49eb (patch)
tree5dbbeeba42680a30c43ccd1d1be3be89925d73d3 /test/run_tests.cpp
parent35362f8137b2c5109e6bc39cb12048c016b5b580 (diff)
downloadzig-8187396f640d2a56e0d56c7d199074b4590e49eb.tar.gz
zig-8187396f640d2a56e0d56c7d199074b4590e49eb.zip
add syntax to allow symbols to have arbitrary strings as names
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index a08b3ea047..618e75d717 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1394,6 +1394,14 @@ void foo(void (__cdecl *fn_ptr)(void));
add_parseh_case("comment after integer literal", R"SOURCE(
#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
)SOURCE", 1, "pub const SDL_INIT_VIDEO = 32;");
+
+ add_parseh_case("zig keywords in C code", R"SOURCE(
+struct type {
+ int defer;
+};
+ )SOURCE", 2, R"(export struct struct_type {
+ @"defer": c_int,
+})", R"(pub const @"type" = struct_type;)");
}
static void run_self_hosted_test(void) {