Index: gcc/testsuite/ChangeLog.pph

2011-08-10  Lawrence Crowl  <crowl@google.com>

	* lib/dg-pph.exp: Compile with -fno-dwarf2-cfi-asm to reduce
	environmental differences.
	* g++.dg/pph/z0expinstnin1.h: Remove in favor of new tests.
	* g++.dg/pph/x0tmplfuncninl3.h: New.
	* g++.dg/pph/x0tmplclass12.h: New.
	* g++.dg/pph/a0tmplfuncninl_u.h: New.
	* g++.dg/pph/x4tmplfuncninl.cc: New.
	* g++.dg/pph/z4tmplfuncninl.cc: New.
	* g++.dg/pph/x0tmplclass2.h: Remove in favor of new tests.
	* g++.dg/pph/x1tmplfunc.cc: Remove in favor of new tests.
	* g++.dg/pph/x0tmplfunc.h: Remove in favor of new tests.
	* g++.dg/pph/x0tmplfuncinln3.h: New.
	* g++.dg/pph/x0template2.h: Remove in favor of new tests.
	* g++.dg/pph/z4expinstinl.cc: Remove in favor of new tests.
	* g++.dg/pph/x0tmplclass21.h: New.
	* g++.dg/pph/a0tmplfuncinln_u.h: New.
	* g++.dg/pph/x4tmplfuncinln.cc: New.
	* g++.dg/pph/z4tmplfuncinln.cc: New.
	* g++.dg/pph/z0expinstnin2.h: Remove in favor of new tests.
	* g++.dg/pph/a0template.h: Remove in favor of new tests.
	* g++.dg/pph/pph.exp: Enable e and z tests.
	* g++.dg/pph/z4tmplclass2.cc: New.
	* g++.dg/pph/x0tmplfuncninl4.h: New.
	* g++.dg/pph/a0tmplclass2_g.h: New.
	* g++.dg/pph/x0tmplclass13.h: New.
	* g++.dg/pph/x1template.cc: Remove in favor of new tests.
	* g++.dg/pph/a0tmplclass2_s.h: New.
	* g++.dg/pph/a0tmplclass1_u.h: New.
	* g++.dg/pph/x4tmplclass1.cc: New.
	* g++.dg/pph/x0tmplfuncinln4.h: New.
	* g++.dg/pph/x1tmplclass.cc: Remove in favor of new tests.
	* g++.dg/pph/a0expinstinl.h: Remove in favor of new tests.
	* g++.dg/pph/x0tmplclass22.h: New.
	* g++.dg/pph/x1tmplfuncninl.cc: New.
	* g++.dg/pph/a0tmplclass.h: Remove in favor of new tests.
	* g++.dg/pph/x4template.cc: Remove in favor of new tests.
	* g++.dg/pph/x1tmplclass1.cc: New.
	* g++.dg/pph/z4nontrivinit.cc: Add xdiff.
	* g++.dg/pph/e4variables.cc: Add xdiff.
	* g++.dg/pph/a0tmplfuncninl_g.h: New.
	* g++.dg/pph/x0tmplfuncninl1.h: New.
	* g++.dg/pph/z4expinstnin.cc: Remove in favor of new tests.
	* g++.dg/pph/a0tmplfuncninl_s.h: New.
	* g++.dg/pph/x0tmplclass14.h: New.
	* g++.dg/pph/a0expinstnin.h: Remove in favor of new tests.
	* g++.dg/pph/x1tmplfuncinln.cc: New.
	* g++.dg/pph/z0expinstinl1.h: Remove in favor of new tests.
	* g++.dg/pph/a0tmplfuncinln_g.h: New.
	* g++.dg/pph/x0tmplfuncinln1.h: New.
	* g++.dg/pph/a0tmplfuncinln_s.h: New.
	* g++.dg/pph/x0tmplclass23.h: New.
	* g++.dg/pph/x4tmplclass2.cc: New.
	* g++.dg/pph/x0tmplfuncninl2.h: New.
	* g++.dg/pph/a0tmplclass1_g.h: New.
	* g++.dg/pph/x0tmplclass11.h: New.
	* g++.dg/pph/e4noninline.cc: Remove xdiff.
	* g++.dg/pph/a0tmplclass1_s.h: New.
	* g++.dg/pph/z0expinstinl2.h: Remove in favor of new tests.
	* g++.dg/pph/a0tmplclass2_u.h: New.
	* g++.dg/pph/x0tmplclass1.h: Remove in favor of new tests.
	* g++.dg/pph/x1tmplclass2.cc: New.
	* g++.dg/pph/z4tmplclass1.cc: New.
	* g++.dg/pph/x0tmplfuncinln2.h: New.
	* g++.dg/pph/x0template1.h: Remove in favor of new tests.
	* g++.dg/pph/x0tmplclass24.h: New.


Index: gcc/testsuite/lib/dg-pph.exp
===================================================================
--- gcc/testsuite/lib/dg-pph.exp	(revision 177632)
+++ gcc/testsuite/lib/dg-pph.exp	(working copy)
@@ -54,7 +54,7 @@ proc dg-pph-neg { subdir test options ma
     verbose -log "\nTesting $nshort, $options"
 
     set dg-do-what-default compile
-    dg-test -keep-output $test "$options $mapflag -I." ""
+    dg-test -keep-output $test "-fno-dwarf2-cfi-asm $options $mapflag -I." ""
 
     if { [file_on_host exists "$bname.s"] } {
 	file_on_host delete "$bname.s"
@@ -76,7 +76,7 @@ proc dg-pph-pos { subdir test options ma
 
     # Compile the file the first time for a base case.
     set dg-do-what-default compile
-    dg-test -keep-output $test "$options -I." ""
+    dg-test -keep-output $test "-fno-dwarf2-cfi-asm $options -I." ""
 
     # Determine whether this is an assembly comparison test
     set is_exec [llength [grep $test "dg-do run"]]
@@ -102,7 +102,7 @@ proc dg-pph-pos { subdir test options ma
     verbose -log ""
 
     # Compile a second time using the pph files.
-    dg-test -keep-output $test "$options $mapflag -I." ""
+    dg-test -keep-output $test "-fno-dwarf2-cfi-asm $options $mapflag -I." ""
 
     if { !$is_asm } {
 	# No assembly means we cannot compare them,
Index: gcc/testsuite/g++.dg/pph/z0expinstnin1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/z0expinstnin1.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/z0expinstnin1.h	(working copy)
@@ -1,6 +0,0 @@
-#ifndef X0EXPINSTNIN1_H
-#define X0EXPINSTNIN1_H
-
-#include "a0expinstnin.h"
-
-#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncninl3.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncninl3.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncninl3.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLFUNCNINL3_H
+#define X0TMPLFUNCNINL3_H
+
+#include "a0tmplfuncninl_g.h"
+#include "a0tmplfuncninl_s.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplclass12.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass12.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass12.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef X0TMPLCLASS12_H
+#define X0TMPLCLASS12_H
+
+#include "a0tmplclass1_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplfuncninl_u.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplfuncninl_u.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplfuncninl_u.h	(revision 0)
@@ -0,0 +1,9 @@
+#ifndef A0TMPLFUNCNINL_U_H
+#define A0TMPLFUNCNINL_U_H
+
+double tmplfuncninl_user()
+{
+    return function2('a') + function2(4) + function2(5.6);
+}
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x4tmplfuncninl.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4tmplfuncninl.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x4tmplfuncninl.cc	(revision 0)
@@ -0,0 +1,4 @@
+// pph asm xdiff 37887
+#include "x0tmplfuncninl1.h"
+#include "x0tmplfuncninl2.h"
+#include "a0tmplfuncninl_u.h"
Index: gcc/testsuite/g++.dg/pph/z4tmplfuncninl.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/z4tmplfuncninl.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/z4tmplfuncninl.cc	(revision 0)
@@ -0,0 +1,4 @@
+// pph asm xdiff 05125
+#include "x0tmplfuncninl3.h"
+#include "x0tmplfuncninl4.h"
+#include "a0tmplfuncninl_u.h"
Index: gcc/testsuite/g++.dg/pph/x0tmplclass2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass2.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass2.h	(working copy)
@@ -1,4 +0,0 @@
-#ifndef X0TMPLCLASS2_H
-#define X0TMPLCLASS2_H
-#include "a0tmplclass.h"
-#endif
Index: gcc/testsuite/g++.dg/pph/x1tmplfunc.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1tmplfunc.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x1tmplfunc.cc	(working copy)
@@ -1,14 +0,0 @@
-#include "x0tmplfunc.h"
-
-type val = 3;
-
-template<>
-int identity< type >(type arg)
-{ return arg + val; }
-
-template
-short identity(short arg);
-
-int main() {
-  return identity( 'a' );
-}
Index: gcc/testsuite/g++.dg/pph/x0tmplfunc.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfunc.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x0tmplfunc.h	(working copy)
@@ -1,9 +0,0 @@
-#ifndef X0TMPLFUNC_H
-#define X0TMPLFUNC_H
-typedef int type;
-extern type val;
-
-template< typename T >
-T identity(T arg)
-{ return arg + val; }
-#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncinln3.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncinln3.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncinln3.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLFUNCINLN3_H
+#define X0TMPLFUNCINLN3_H
+
+#include "a0tmplfuncinln_g.h"
+#include "a0tmplfuncinln_s.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0template2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0template2.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x0template2.h	(working copy)
@@ -1,4 +0,0 @@
-#ifndef X0TEMPLATE2_H
-#define X0TEMPLATE2_H
-#include "a0template.h"
-#endif
Index: gcc/testsuite/g++.dg/pph/z4expinstinl.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/z4expinstinl.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/z4expinstinl.cc	(working copy)
@@ -1,12 +0,0 @@
-// pph asm xdiff 10014
-//FIXME Emitting a second copy of the explicit instantiation of 'function'.
-//FIXME With comdat, the linker may paper over the differences.
-
-#include "z0expinstinl1.h"
-#include "z0expinstinl2.h"
-
-int main()
-{
-  int var = 1;
-  return function(var);
-}
Index: gcc/testsuite/g++.dg/pph/x0tmplclass21.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass21.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass21.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLCLASS21_H
+#define X0TMPLCLASS21_H
+
+#include "a0tmplclass1_g.h"
+#include "a0tmplclass2_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplfuncinln_u.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplfuncinln_u.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplfuncinln_u.h	(revision 0)
@@ -0,0 +1,9 @@
+#ifndef A0TMPLFUNCINLN_U_H
+#define A0TMPLFUNCINLN_U_H
+
+double tmplfuncinln_user()
+{
+    return function1('a') + function1(4) + function1(5.6);
+}
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x4tmplfuncinln.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4tmplfuncinln.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x4tmplfuncinln.cc	(revision 0)
@@ -0,0 +1,6 @@
+// pph asm xdiff 16845
+// duplicate function emission
+
+#include "x0tmplfuncinln1.h"
+#include "x0tmplfuncinln2.h"
+#include "a0tmplfuncinln_u.h"
Index: gcc/testsuite/g++.dg/pph/z4tmplfuncinln.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/z4tmplfuncinln.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/z4tmplfuncinln.cc	(revision 0)
@@ -0,0 +1,4 @@
+// pph asm xdiff 65129
+#include "x0tmplfuncinln3.h"
+#include "x0tmplfuncinln4.h"
+#include "a0tmplfuncinln_u.h"
Index: gcc/testsuite/g++.dg/pph/z0expinstnin2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/z0expinstnin2.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/z0expinstnin2.h	(working copy)
@@ -1,6 +0,0 @@
-#ifndef X0EXPINSTNIN2_H
-#define X0EXPINSTNIN2_H
-
-#include "a0expinstnin.h"
-
-#endif
Index: gcc/testsuite/g++.dg/pph/a0template.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0template.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/a0template.h	(working copy)
@@ -1,20 +0,0 @@
-#ifndef A0TEMPLATE_H
-#define A0TEMPLATE_H
-extern int x;
-struct B;
-template< typename T >
-struct C {
-    T* b;
-    int method();
-    int another()
-    { return *b; }
-};
-template< typename T >
-int C< T >::method()
-{ return x; }
-struct D : C< int > {
-    int method();
-    int another()
-    { return *b; }
-};
-#endif
Index: gcc/testsuite/g++.dg/pph/pph.exp
===================================================================
--- gcc/testsuite/g++.dg/pph/pph.exp	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/pph.exp	(working copy)
@@ -29,10 +29,9 @@ dg-init
 # FIXME set scenarios [list "" "-g" "-O"]
 set scenarios [list "" ]
 
-# FIXME enable p and z tests when we feel we are ready
-set hdr_tests [lsort [glob -nocomplain $srcdir/$subdir/\[cdpxy\]*.h]]
+set hdr_tests [lsort [glob -nocomplain $srcdir/$subdir/\[cdepxyz\]*.h]]
 set neg_tests [lsort [glob -nocomplain $srcdir/$subdir/\[dy\]*.cc]]
-set pos_tests [lsort [glob -nocomplain $srcdir/$subdir/\[cpx\]*.cc]]
+set pos_tests [lsort [glob -nocomplain $srcdir/$subdir/\[cepxz\]*.cc]]
 
 exec ls $srcdir/$subdir | sed -e /^\[cpdxy\].*\.h$/!d -e s/.*/&\t&/ -e s/\.h$/\.pph/ > pph.map
 exec echo "math.h	math.pph" >> pph.map
Index: gcc/testsuite/g++.dg/pph/z4tmplclass2.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/z4tmplclass2.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/z4tmplclass2.cc	(revision 0)
@@ -0,0 +1,6 @@
+// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } }
+// { dg-bogus "z4tmplclass2.cc:1:0: fatal error: LTO_tags out of range: Range is 0 to 355, value is 22276" "" { xfail *-*-* } 0 }
+
+#include "x0tmplclass23.h"
+#include "x0tmplclass24.h"
+#include "a0tmplclass2_u.h"
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncninl4.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncninl4.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncninl4.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLFUNCNINL4_H
+#define X0TMPLFUNCNINL4_H
+
+#include "a0tmplfuncninl_g.h"
+#include "a0tmplfuncninl_s.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplclass2_g.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplclass2_g.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplclass2_g.h	(revision 0)
@@ -0,0 +1,53 @@
+#ifndef A0TMPLCLASS2_G_H
+#define A0TMPLCLASS2_G_H
+
+template<>
+short base< short >::variable;
+
+template<>
+short base< short >::dynamic_early_inline()
+{ return 2 * field; }
+
+template<>
+inline short base< short >::dynamic_late_inline()
+{ return 2 * field; }
+
+template<>
+short base< short >::static_early_inline()
+{ return 2 * variable; }
+
+template<>
+inline short base< short >::static_late_inline()
+{ return 2 * variable; }
+
+
+template<>
+struct base<double>
+{
+    double d_field;
+    static double d_variable;
+
+    double d_dynamic_in_class() { return d_field; }
+    inline double d_dynamic_early_inline();
+    double d_dynamic_late_inline();
+    double d_dynamic_non_inline();
+
+    static double d_static_in_class() { return d_variable; }
+    static inline double d_static_early_inline();
+    static double d_static_late_inline();
+    static double d_static_non_inline();
+};
+
+double base< double >::d_dynamic_early_inline()
+{ return d_field; }
+
+inline double base< double >::d_dynamic_late_inline()
+{ return d_field; }
+
+double base< double >::d_static_early_inline()
+{ return d_variable; }
+
+inline double base< double >::d_static_late_inline()
+{ return d_variable; }
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplclass13.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass13.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass13.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLCLASS13_H
+#define X0TMPLCLASS13_H
+
+#include "a0tmplclass1_g.h"
+#include "a0tmplclass1_s.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x1template.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1template.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x1template.cc	(working copy)
@@ -1,11 +0,0 @@
-#include "x0template1.h"
-
-int x = 3;
-
-int y = 4;
-
-int D::method()
-{ return y; }
-
-int main()
-{ }
Index: gcc/testsuite/g++.dg/pph/a0tmplclass2_s.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplclass2_s.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplclass2_s.h	(revision 0)
@@ -0,0 +1,24 @@
+#ifndef A0TMPLCLASS2_S_H
+#define A0TMPLCLASS2_S_H
+
+template<>
+short base< short >::variable = 2;
+
+template<>
+short base< short >::dynamic_non_inline()
+{ return 2 * field; }
+
+template<>
+short base< short >::static_non_inline()
+{ return 2 * variable; }
+
+
+double base< double >::d_variable = 3;
+
+double base< double >::d_dynamic_non_inline()
+{ return d_field; }
+
+double base< double >::d_static_non_inline()
+{ return d_variable; }
+
+#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplclass1_u.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplclass1_u.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplclass1_u.h	(revision 0)
@@ -0,0 +1,25 @@
+#ifndef A0TMPLCLASS1_U_H
+#define A0TMPLCLASS1_U_H
+
+double tmplclass_user1()
+{
+    base<char> variable1;
+    base<int> variable2;
+    base<double> variable3;
+    return
+        variable1.dynamic_in_class() + base<char>::static_in_class()
+        + variable1.dynamic_early_inline() + base<char>::static_early_inline()
+        + variable1.dynamic_late_inline() + base<char>::static_late_inline()
+        + variable1.dynamic_non_inline() + base<char>::static_non_inline()
+        + variable2.dynamic_in_class() + base<int>::static_in_class()
+        + variable2.dynamic_early_inline() + base<int>::static_early_inline()
+        + variable2.dynamic_late_inline() + base<int>::static_late_inline()
+        + variable2.dynamic_non_inline() + base<int>::static_non_inline()
+        + variable3.dynamic_in_class() + base<double>::static_in_class()
+        + variable3.dynamic_early_inline() + base<double>::static_early_inline()
+        + variable3.dynamic_late_inline() + base<double>::static_late_inline()
+        + variable3.dynamic_non_inline() + base<double>::static_non_inline();
+}
+
+#endif
+
Index: gcc/testsuite/g++.dg/pph/x4tmplclass1.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4tmplclass1.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x4tmplclass1.cc	(revision 0)
@@ -0,0 +1,4 @@
+// pph asm xdiff 36067
+#include "x0tmplclass11.h"
+#include "x0tmplclass12.h"
+#include "a0tmplclass1_u.h"
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncinln4.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncinln4.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncinln4.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLFUNCINLN4_H
+#define X0TMPLFUNCINLN4_H
+
+#include "a0tmplfuncinln_g.h"
+#include "a0tmplfuncinln_s.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x1tmplclass.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1tmplclass.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x1tmplclass.cc	(working copy)
@@ -1,16 +0,0 @@
-#include "x0tmplclass1.h"
-
-int wrapper<char>::cache = 2;
-
-template
-struct wrapper<short>;
-
-template
-long wrapper<long>::cache;
-
-int main() {
-  wrapper<char> vc;
-  wrapper<short> vs;
-  wrapper<int> vi;
-  return 0;
-}
Index: gcc/testsuite/g++.dg/pph/a0expinstinl.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0expinstinl.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/a0expinstinl.h	(working copy)
@@ -1,12 +0,0 @@
-#ifndef A0EXPINSTINL_H
-#define A0EXPINSTINL_H
-
-template< typename T >
-inline int function( T t )
-{
-    return t * 2;
-}
-
-template int function(int);
-
-#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplclass22.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass22.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass22.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLCLASS22_H
+#define X0TMPLCLASS22_H
+
+#include "a0tmplclass1_g.h"
+#include "a0tmplclass2_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x1tmplfuncninl.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1tmplfuncninl.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x1tmplfuncninl.cc	(revision 0)
@@ -0,0 +1,3 @@
+#include "x0tmplfuncninl1.h"
+#include "a0tmplfuncninl_s.h"
+#include "a0tmplfuncninl_u.h"
Index: gcc/testsuite/g++.dg/pph/a0tmplclass.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplclass.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/a0tmplclass.h	(working copy)
@@ -1,17 +0,0 @@
-#ifndef A0TMPLCLASS_H
-#define A0TMPLCLASS_H
-template< typename T >
-struct wrapper {
-  T value;
-  static T cache;
-};
-
-template< typename T >
-T wrapper<T>::cache = 3;
-
-template<>
-struct wrapper<char> {
-  int value;
-  static int cache;
-};
-#endif
Index: gcc/testsuite/g++.dg/pph/x4template.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4template.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x4template.cc	(working copy)
@@ -1,14 +0,0 @@
-// pph asm xdiff 52012
-
-#include "x0template1.h"
-#include "x0template2.h"
-
-int x = 3;
-
-int y = 4;
-
-int D::method()
-{ return y; }
-
-int main()
-{ }
Index: gcc/testsuite/g++.dg/pph/x1tmplclass1.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1tmplclass1.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x1tmplclass1.cc	(revision 0)
@@ -0,0 +1,3 @@
+// pph asm xdiff 11432
+#include "x0tmplclass13.h"
+#include "a0tmplclass1_u.h"
Index: gcc/testsuite/g++.dg/pph/z4nontrivinit.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/z4nontrivinit.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/z4nontrivinit.cc	(working copy)
@@ -1,2 +1,3 @@
+// pph asm xdiff 65039
 #include "x0nontrivinit1.h"
 #include "x0nontrivinit2.h"
Index: gcc/testsuite/g++.dg/pph/e4variables.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/e4variables.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/e4variables.cc	(working copy)
@@ -1,3 +1,4 @@
+// pph asm xdiff 26015
 #include "c0variables3.h"
 #include "c0variables4.h"
 
Index: gcc/testsuite/g++.dg/pph/a0tmplfuncninl_g.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplfuncninl_g.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplfuncninl_g.h	(revision 0)
@@ -0,0 +1,15 @@
+#ifndef A0TMPLFUNCNINL_G_H
+#define A0TMPLFUNCNINL_G_H
+
+template< typename T >
+T function2( T t )
+{
+    return t * 3;
+}
+
+inline char instantiator2(char c)
+{
+    return function2(c);
+}
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncninl1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncninl1.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncninl1.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef X0TMPLFUNCNINL1_H
+#define X0TMPLFUNCNINL1_H
+
+#include "a0tmplfuncninl_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/z4expinstnin.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/z4expinstnin.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/z4expinstnin.cc	(working copy)
@@ -1,8 +0,0 @@
-#include "z0expinstnin1.h"
-#include "z0expinstnin2.h"
-
-int main()
-{
-  int var = 1;
-  return function(var);
-}
Index: gcc/testsuite/g++.dg/pph/a0tmplfuncninl_s.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplfuncninl_s.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplfuncninl_s.h	(revision 0)
@@ -0,0 +1,11 @@
+#ifndef A0TMPLFUNCNINL_S_H
+#define A0TMPLFUNCNINL_S_H
+
+template int function2(int);
+
+template<> double function2(double d)
+{
+    return d * 4.0;
+}
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplclass14.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass14.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass14.h	(revision 0)
@@ -0,0 +1,7 @@
+#ifndef X0TMPLCLASS14_H
+#define X0TMPLCLASS14_H
+
+#include "a0tmplclass1_g.h"
+#include "a0tmplclass1_s.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/a0expinstnin.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0expinstnin.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/a0expinstnin.h	(working copy)
@@ -1,12 +0,0 @@
-#ifndef A0EXPINSTNIN_H
-#define A0EXPINSTNIN_H
-
-template< typename T >
-int function( T t )
-{
-    return t * 2;
-}
-
-template int function(int);
-
-#endif
Index: gcc/testsuite/g++.dg/pph/x1tmplfuncinln.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1tmplfuncinln.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x1tmplfuncinln.cc	(revision 0)
@@ -0,0 +1,3 @@
+#include "x0tmplfuncinln1.h"
+#include "a0tmplfuncinln_s.h"
+#include "a0tmplfuncinln_u.h"
Index: gcc/testsuite/g++.dg/pph/z0expinstinl1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/z0expinstinl1.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/z0expinstinl1.h	(working copy)
@@ -1,6 +0,0 @@
-#ifndef X0EXPINSTINL1_H
-#define X0EXPINSTINL1_H
-
-#include "a0expinstinl.h"
-
-#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplfuncinln_g.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplfuncinln_g.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplfuncinln_g.h	(revision 0)
@@ -0,0 +1,20 @@
+#ifndef A0TMPLFUNCINLN_G_H
+#define A0TMPLFUNCINLN_G_H
+
+template< typename T >
+inline T function1( T t )
+{
+    return t * 2;
+}
+
+template<> double function1(double d)
+{
+    return d * 3.0;
+}
+
+inline char instantiator1(char c)
+{
+    return function1(c);
+}
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncinln1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncinln1.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncinln1.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef X0TMPLFUNCINLN1_H
+#define X0TMPLFUNCINLN1_H
+
+#include "a0tmplfuncinln_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplfuncinln_s.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplfuncinln_s.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplfuncinln_s.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef A0TMPLFUNCINLN_S_H
+#define A0TMPLFUNCINLN_S_H
+
+template int function1(int);
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplclass23.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass23.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass23.h	(revision 0)
@@ -0,0 +1,9 @@
+#ifndef X0TMPLCLASS13_H
+#define X0TMPLCLASS13_H
+
+#include "a0tmplclass1_g.h"
+#include "a0tmplclass1_s.h"
+#include "a0tmplclass2_g.h"
+#include "a0tmplclass2_s.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x4tmplclass2.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4tmplclass2.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x4tmplclass2.cc	(revision 0)
@@ -0,0 +1,6 @@
+// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } }
+// { dg-bogus "x4tmplclass2.cc:1:0: fatal error: LTO_tags out of range: Range is 0 to 355, value is 22275" "" { xfail *-*-* } 0 }
+
+#include "x0tmplclass21.h"
+#include "x0tmplclass22.h"
+#include "a0tmplclass2_u.h"
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncninl2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncninl2.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncninl2.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef X0TMPLFUNCNINL2_H
+#define X0TMPLFUNCNINL2_H
+
+#include "a0tmplfuncninl_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplclass1_g.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplclass1_g.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplclass1_g.h	(revision 0)
@@ -0,0 +1,59 @@
+#ifndef A0TMPLCLASS1_G_H
+#define A0TMPLCLASS1_G_H
+
+template< typename T >
+struct base
+{
+    T field;
+    static T variable;
+
+    T dynamic_in_class() { return field; }
+    inline T dynamic_early_inline();
+    T dynamic_late_inline();
+    T dynamic_non_inline();
+
+    static T static_in_class() { return variable; }
+    static inline T static_early_inline();
+    static T static_late_inline();
+    static T static_non_inline();
+};
+
+template< typename T >
+T base< T >::variable = 1;
+
+template< typename T >
+T base< T >::dynamic_early_inline()
+{ return field; }
+
+template< typename T >
+inline T base< T >::dynamic_late_inline()
+{ return field; }
+
+template< typename T >
+T base< T >::dynamic_non_inline()
+{ return field; }
+
+template< typename T >
+T base< T >::static_early_inline()
+{ return variable; }
+
+template< typename T >
+inline T base< T >::static_late_inline()
+{ return variable; }
+
+template< typename T >
+T base< T >::static_non_inline()
+{ return variable; }
+
+
+inline char instantiator1(char c)
+{
+    base<char> variable;
+    return
+        variable.dynamic_in_class() + base<char>::static_in_class()
+        + variable.dynamic_early_inline() + base<char>::static_early_inline()
+        + variable.dynamic_late_inline() + base<char>::static_late_inline()
+        + variable.dynamic_non_inline() + base<char>::static_non_inline();
+}
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplclass11.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass11.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass11.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef X0TMPLCLASS11_H
+#define X0TMPLCLASS11_H
+
+#include "a0tmplclass1_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/e4noninline.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/e4noninline.cc	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/e4noninline.cc	(working copy)
@@ -1,7 +1,3 @@
-// pph asm xdiff 52472
-//FIXME Emitting a second copy of the non-inline function f.
-//FIXME The linker should choke over this one.
-
 #include "e0noninline1.h"
 #include "e0noninline2.h"
 
Index: gcc/testsuite/g++.dg/pph/a0tmplclass1_s.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplclass1_s.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplclass1_s.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef A0TMPLCLASS1_S_H
+#define A0TMPLCLASS1_S_H
+
+template struct base< int >;
+
+#endif
Index: gcc/testsuite/g++.dg/pph/z0expinstinl2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/z0expinstinl2.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/z0expinstinl2.h	(working copy)
@@ -1,6 +0,0 @@
-#ifndef X0EXPINSTINL2_H
-#define X0EXPINSTINL2_H
-
-#include "a0expinstinl.h"
-
-#endif
Index: gcc/testsuite/g++.dg/pph/a0tmplclass2_u.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0tmplclass2_u.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0tmplclass2_u.h	(revision 0)
@@ -0,0 +1,29 @@
+#ifndef A0TMPLCLASS2_U_H
+#define A0TMPLCLASS2_U_H
+
+double tmplclass_user2()
+{
+    base<char> variable1;
+    base<int> variable2;
+    base<double> variable3;
+    return
+        variable1.dynamic_in_class() + base<char>::static_in_class()
+        + variable1.dynamic_early_inline() + base<char>::static_early_inline()
+        + variable1.dynamic_late_inline() + base<char>::static_late_inline()
+        + variable1.dynamic_non_inline() + base<char>::static_non_inline()
+        + variable2.dynamic_in_class() + base<int>::static_in_class()
+        + variable2.dynamic_early_inline() + base<int>::static_early_inline()
+        + variable2.dynamic_late_inline() + base<int>::static_late_inline()
+        + variable2.dynamic_non_inline() + base<int>::static_non_inline()
+        + variable3.d_dynamic_in_class()
+        + base<double>::d_static_in_class()
+        + variable3.d_dynamic_early_inline()
+        + base<double>::d_static_early_inline()
+        + variable3.d_dynamic_late_inline()
+        + base<double>::d_static_late_inline()
+        + variable3.d_dynamic_non_inline()
+        + base<double>::d_static_non_inline();
+}
+
+#endif
+
Index: gcc/testsuite/g++.dg/pph/x0tmplclass1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass1.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass1.h	(working copy)
@@ -1,4 +0,0 @@
-#ifndef X0TMPLCLASS1_H
-#define X0TMPLCLASS1_H
-#include "a0tmplclass.h"
-#endif
Index: gcc/testsuite/g++.dg/pph/x1tmplclass2.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x1tmplclass2.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x1tmplclass2.cc	(revision 0)
@@ -0,0 +1,5 @@
+// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } }
+// { dg-bogus "x1tmplclass2.cc:1:0: fatal error: LTO_tags out of range: Range is 0 to 355, value is 22276" "" { xfail *-*-* } 0 }
+
+#include "x0tmplclass23.h"
+#include "a0tmplclass2_u.h"
Index: gcc/testsuite/g++.dg/pph/z4tmplclass1.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/z4tmplclass1.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/z4tmplclass1.cc	(revision 0)
@@ -0,0 +1,4 @@
+// pph asm xdiff 10444
+#include "x0tmplclass13.h"
+#include "x0tmplclass14.h"
+#include "a0tmplclass1_u.h"
Index: gcc/testsuite/g++.dg/pph/x0tmplfuncinln2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplfuncinln2.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplfuncinln2.h	(revision 0)
@@ -0,0 +1,6 @@
+#ifndef X0TMPLFUNCINLN2_H
+#define X0TMPLFUNCINLN2_H
+
+#include "a0tmplfuncinln_g.h"
+
+#endif
Index: gcc/testsuite/g++.dg/pph/x0template1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0template1.h	(revision 177632)
+++ gcc/testsuite/g++.dg/pph/x0template1.h	(working copy)
@@ -1,4 +0,0 @@
-#ifndef X0TEMPLATE1_H
-#define X0TEMPLATE1_H
-#include "a0template.h"
-#endif
Index: gcc/testsuite/g++.dg/pph/x0tmplclass24.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0tmplclass24.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0tmplclass24.h	(revision 0)
@@ -0,0 +1,9 @@
+#ifndef X0TMPLCLASS24_H
+#define X0TMPLCLASS24_H
+
+#include "a0tmplclass1_g.h"
+#include "a0tmplclass1_s.h"
+#include "a0tmplclass2_g.h"
+#include "a0tmplclass2_s.h"
+
+#endif
