aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/plugin/show_template_tree_color_plugin.c
blob: e1af2cf25a4eb3a4617c501ecce4eac89516408c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* We want to verify the colorized output of cxx_format_postprocessor,
   but turning on colorization for everything confuses "dg-error" etc.
   The color codes in the generated messages would also need escaping
   for use within dg-error.

   Hence the simplest approach is to provide a custom diagnostic_starter_fn,
   which does nothing.

   The resulting messages lack the "FILENAME:LINE:COL: error: " prefix
   and can thus be tested using dg-begin/end-multiline-output.  */

/* { dg-options "-O" } */

#include "gcc-plugin.h"
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "plugin-version.h"
#include "diagnostic.h"

int plugin_is_GPL_compatible;

void
noop_starter_fn (diagnostic_context *, const diagnostic_info *)
{
}

int
plugin_init (struct plugin_name_args *plugin_info,
	     struct plugin_gcc_version *version)
{
  if (!plugin_default_version_check (version, &gcc_version))
    return 1;

  diagnostic_starter (global_dc) = noop_starter_fn;

  return 0;
}