aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorrylmovuk <kov1maxim1al@gmail.com>2019-04-25 23:32:57 +0200
committerAndrew Kelley <andrew@ziglang.org>2019-04-26 14:23:56 -0400
commit4df2f3d74f140ae6a60dc33d3e0fb7b25f29d5b9 (patch)
tree0d2d89defeffa255bc57c742f6923cbc5f3994eb /src/analyze.cpp
parent92d9cef07116da8639ac33b7fd83ba1b35f0750c (diff)
downloadzig-4df2f3d74f140ae6a60dc33d3e0fb7b25f29d5b9.tar.gz
zig-4df2f3d74f140ae6a60dc33d3e0fb7b25f29d5b9.zip
Change symbol name of tests in codegen
Tests now have the symbol name of the format `test "<name>"` in order to be more easily distinguished from functions with similar names. See issue #2267.
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 158a4bc94f..c0ec71a00e 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -2790,7 +2790,10 @@ static void resolve_decl_fn(CodeGen *g, TldFn *tld_fn) {
} else if (source_node->type == NodeTypeTestDecl) {
ZigFn *fn_table_entry = create_fn_raw(g, FnInlineAuto);
- get_fully_qualified_decl_name(&fn_table_entry->symbol_name, &tld_fn->base);
+ Buf test_fn_name = BUF_INIT;
+ get_fully_qualified_decl_name(&test_fn_name, &tld_fn->base);
+ buf_resize(&fn_table_entry->symbol_name, 0);
+ buf_appendf(&fn_table_entry->symbol_name, "test \"%s\"", buf_ptr(&test_fn_name));
tld_fn->fn_entry = fn_table_entry;