ccls/tests/usage/func_usage_addr_func.cc

57 lines
1.7 KiB
C++
Raw Normal View History

2017-02-18 21:18:08 +00:00
void consume(void*) {}
void used() {}
void user() {
auto x = &used;
consume(&used);
}
/*
2017-02-18 23:58:40 +00:00
// NOTE: used only has one caller!!
2017-02-18 21:18:08 +00:00
OUTPUT:
{
"types": [{
2017-02-18 23:58:40 +00:00
"id": 0
2017-02-18 21:18:08 +00:00
}],
"functions": [{
"id": 0,
2017-02-18 23:58:40 +00:00
"usr": "c:@F@consume#*v#",
2017-02-18 21:18:08 +00:00
"short_name": "consume",
"qualified_name": "consume",
"definition": "tests/usage/func_usage_addr_func.cc:1:6",
"callers": ["2@tests/usage/func_usage_addr_func.cc:7:3"],
"uses": ["tests/usage/func_usage_addr_func.cc:7:3"]
}, {
"id": 1,
2017-02-18 23:58:40 +00:00
"usr": "c:@F@used#",
2017-02-18 21:18:08 +00:00
"short_name": "used",
"qualified_name": "used",
"definition": "tests/usage/func_usage_addr_func.cc:3:6",
"callers": ["2@tests/usage/func_usage_addr_func.cc:6:13", "2@tests/usage/func_usage_addr_func.cc:7:12"],
"uses": ["tests/usage/func_usage_addr_func.cc:6:13", "tests/usage/func_usage_addr_func.cc:7:12"]
}, {
"id": 2,
2017-02-18 23:58:40 +00:00
"usr": "c:@F@user#",
2017-02-18 21:18:08 +00:00
"short_name": "user",
"qualified_name": "user",
"definition": "tests/usage/func_usage_addr_func.cc:5:6",
2017-02-18 23:58:40 +00:00
"callees": ["1@tests/usage/func_usage_addr_func.cc:6:13", "0@tests/usage/func_usage_addr_func.cc:7:3", "1@tests/usage/func_usage_addr_func.cc:7:12"]
2017-02-18 21:18:08 +00:00
}],
"variables": [{
"id": 0,
"declaration": "tests/usage/func_usage_addr_func.cc:1:19",
"initializations": ["tests/usage/func_usage_addr_func.cc:1:19"],
2017-02-18 23:58:40 +00:00
"variable_type": 0
2017-02-18 21:18:08 +00:00
}, {
"id": 1,
2017-02-18 23:58:40 +00:00
"usr": "c:func_usage_addr_func.cc@61@F@user#@x",
2017-02-18 21:18:08 +00:00
"short_name": "x",
"qualified_name": "x",
"declaration": "tests/usage/func_usage_addr_func.cc:6:8",
"initializations": ["tests/usage/func_usage_addr_func.cc:6:8"],
2017-02-18 23:58:40 +00:00
"variable_type": 0
2017-02-18 21:18:08 +00:00
}]
}
*/