Patchwork [pph] Merge micro tests. (issue4988047)

login
register
mail settings
Submitter Lawrence Crowl
Date Sept. 7, 2011, 9:04 p.m.
Message ID <20110907210406.279DE22268D@jade.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/113837/
State New
Headers show

Comments

Lawrence Crowl - Sept. 7, 2011, 9:04 p.m.
This patch adds new tests for overload resolution.  In contrast to
prior tests, we want these tests to have assembly differences because
PPH binds overloads at header compilation time, not based on accident
of include order.  The test control files change as a consequence.

Changed the compiler command line slightly to make copy/paste searches
easier.

Corrected the keyno test to actually not have a key method.  (There
were incomplete copy/paste/edit actions in the original change.)
However, the incorrect tests were failing for other reasons, and that
test has been preserved as a new test.

Test x7rtti.cc was unresolved because the run test was failing to
compile.  Updated test x7rtti.cc to supress the dg-run, until the
compile problems are fixed.

Tests run on x64.



--
This patch is available for review at http://codereview.appspot.com/4988047

Patch

Index: gcc/testsuite/ChangeLog.pph

2011-09-07   Lawrence Crowl  <crowl@google.com>

	* a0vardef.h: New.
	* c0vardef1.h: New.
	* x4structover1.cc: New.
	* c0vardef2.h: New.
	* x0structover1.h: New.
	* c4vardef.cc: New.
	* x4structover2.cc: New.
	* x0structover2.h: New.
	* x4resolve1.cc: Add more overloaded calls.
	* x4resolve2.cc: Add more overloaded calls.


Index: gcc/testsuite/g++.dg/pph/x4resolve1.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4resolve1.cc	(revision 178657)
+++ gcc/testsuite/g++.dg/pph/x4resolve1.cc	(working copy)
@@ -1,9 +1,12 @@ 
-// pph asm xwant 53261
+// pph asm xwant 03374
 
 #include "x0resolve1.h"
 #include "x0resolve2.h"
 
 int caller()
 {
-    return overloader1() + overloader2();
+    int t = intfunc(3l) + fltfunc(2.0);
+    t += intfunc(3) + fltfunc(2.0f);
+    t += overloader1() + overloader2();
+    return t;
 }
Index: gcc/testsuite/g++.dg/pph/a0vardef.h
===================================================================
--- gcc/testsuite/g++.dg/pph/a0vardef.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/a0vardef.h	(revision 0)
@@ -0,0 +1,4 @@ 
+#ifndef A0VARDEF_H 
+#define A0VARDEF_H 
+int variable = 1;
+#endif
Index: gcc/testsuite/g++.dg/pph/c0vardef1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/c0vardef1.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/c0vardef1.h	(revision 0)
@@ -0,0 +1,4 @@ 
+#ifndef C0VARDEF1_H 
+#define C0VARDEF1_H 
+#include "a0vardef.h"
+#endif
Index: gcc/testsuite/g++.dg/pph/x4resolve2.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4resolve2.cc	(revision 178657)
+++ gcc/testsuite/g++.dg/pph/x4resolve2.cc	(working copy)
@@ -1,9 +1,12 @@ 
-// pph asm xwant 12527
+// pph asm xwant 37643
 
 #include "x0resolve2.h"
 #include "x0resolve1.h"
 
 int caller()
 {
-    return overloader1() + overloader2();
+    int t = intfunc(3l) + fltfunc(2.0);
+    t += intfunc(3) + fltfunc(2.0f);
+    t += overloader1() + overloader2();
+    return t;
 }
Index: gcc/testsuite/g++.dg/pph/x4structover1.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4structover1.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x4structover1.cc	(revision 0)
@@ -0,0 +1,9 @@ 
+// { dg-xfail-if "BOGUS" { "*-*-*" } { "-fpph-map=pph.map" } }
+
+
+#include "x0structover1.h"
+#include "x0structover2.h"
+
+int func2() {
+    return func( (S*)0 );
+}
Index: gcc/testsuite/g++.dg/pph/c0vardef2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/c0vardef2.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/c0vardef2.h	(revision 0)
@@ -0,0 +1,4 @@ 
+#ifndef C0VARDEF2_H 
+#define C0VARDEF2_H 
+#include "a0vardef.h"
+#endif
Index: gcc/testsuite/g++.dg/pph/x0structover1.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0structover1.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0structover1.h	(revision 0)
@@ -0,0 +1,5 @@ 
+#ifndef X0STRUCTOVER1_H
+#define X0STRUCTOVER1_H
+#include "a0rawstruct.h"
+inline int func( S* p ) { if ( p ) return 1; else return 0; }
+#endif
Index: gcc/testsuite/g++.dg/pph/c4vardef.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/c4vardef.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/c4vardef.cc	(revision 0)
@@ -0,0 +1,4 @@ 
+// pph asm xdiff 00553
+
+#include "c0vardef1.h"
+#include "c0vardef2.h"
Index: gcc/testsuite/g++.dg/pph/x4structover2.cc
===================================================================
--- gcc/testsuite/g++.dg/pph/x4structover2.cc	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x4structover2.cc	(revision 0)
@@ -0,0 +1,6 @@ 
+#include "x0structover2.h"
+#include "x0structover1.h"
+
+int func2() {
+    return func( (S*)0 );
+}
Index: gcc/testsuite/g++.dg/pph/x0structover2.h
===================================================================
--- gcc/testsuite/g++.dg/pph/x0structover2.h	(revision 0)
+++ gcc/testsuite/g++.dg/pph/x0structover2.h	(revision 0)
@@ -0,0 +1,4 @@ 
+#ifndef X0STRUCTOVER2_H
+#define X0STRUCTOVER2_H
+#include "a0rawstruct.h"
+#endif