OSDN Git Service

* gcc.dg/simulate-thread/simulate-thread.gdb: Call
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / plugin / finish_unit_plugin.c
1 /* This plugin creates a fake function in the FINISH_UNIT callback, in
2  * other words right after compilation of the translation unit. 
3 */
4 #include "gcc-plugin.h"
5 #include "config.h"
6 #include "system.h"
7 #include "coretypes.h"
8 #include "tm.h"
9 #include "toplev.h"
10 #include "basic-block.h"
11 #include "gimple.h"
12 #include "tree.h"
13 #include "tree-pass.h"
14 #include "intl.h"
15 #include "cgraph.h"
16
17 int plugin_is_GPL_compatible;
18
19 static void finish_unit_callback (void *gcc_data, void *user_data)
20 {
21   cgraph_build_static_cdtor ('I', NULL, DEFAULT_INIT_PRIORITY);
22 }
23
24 int plugin_init (struct plugin_name_args *plugin_info,
25                  struct plugin_gcc_version *version)
26 {
27   register_callback ("finish_unit", PLUGIN_FINISH_UNIT, &finish_unit_callback, NULL);
28   return 0;
29 }