summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr66752-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/torture/pr66752-2.C')
-rw-r--r--gcc/testsuite/g++.dg/torture/pr66752-2.C60
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr66752-2.C b/gcc/testsuite/g++.dg/torture/pr66752-2.C
new file mode 100644
index 00000000000..96d3fe9db4b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr66752-2.C
@@ -0,0 +1,60 @@
+/* { dg-do compile } */
+extern "C"
+{
+ typedef struct _IO_FILE FILE;
+ extern int fprintf (FILE * __restrict __stream,
+ const char *__restrict __format, ...);
+}
+typedef union tree_node *tree;
+class ipa_polymorphic_call_context
+{
+};
+class ipcp_value_base
+{
+};
+template < typename valtype > class ipcp_value:public ipcp_value_base
+{
+public:valtype value;
+ ipcp_value *next;
+};
+
+template < typename valtype > class ipcp_lattice
+{
+public:ipcp_value < valtype > *values;
+ void print (FILE * f, bool dump_sources, bool dump_benefits);
+};
+
+class ipcp_param_lattices
+{
+public:ipcp_lattice < tree > itself;
+ ipcp_lattice < ipa_polymorphic_call_context > ctxlat;
+};
+template < typename valtype > void ipcp_lattice < valtype >::print (FILE * f,
+ bool
+ dump_sources,
+ bool
+ dump_benefits)
+{
+ ipcp_value < valtype > *val;
+ bool prev = false;
+ for (val = values; val; val = val->next)
+ {
+ if (dump_benefits && prev)
+ fprintf (f, " ");
+ else if (!dump_benefits && prev)
+ fprintf (f, ", ");
+ else
+ prev = true;
+ if (dump_sources)
+ fprintf (f, "]");
+ if (dump_benefits)
+ fprintf (f, "shit");
+ }
+}
+
+void
+print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits)
+{
+ struct ipcp_param_lattices *plats;
+ plats->ctxlat.print (f, dump_sources, dump_benefits);
+}