Re: [pph] Adding one hard and failing ordering test (issue4854042)

2011-08-08 Thread Diego Novillo
On Fri, Aug 5, 2011 at 18:49, Gabriel Charette  wrote:
> This is the test I was talking would potentially fail with our current 
> implementation.
>
> And it does.
>
> It has an assembly difference in the order of the global variables, like we 
> used to have in simpler tests.
>
> Gab
>
> 2011-08-05  Gabriel Charette  
>
>        * (x0hardorder1.h): New.
>        * (x3hardorder2.h): New.
>        * (x3hardorder.cc): New.

OK.  Thanks for the test.


Diego.


[pph] Adding one hard and failing ordering test (issue4854042)

2011-08-05 Thread Gabriel Charette
This is the test I was talking would potentially fail with our current 
implementation.

And it does.

It has an assembly difference in the order of the global variables, like we 
used to have in simpler tests.

Gab

2011-08-05  Gabriel Charette  

* (x0hardorder1.h): New.
* (x3hardorder2.h): New.
* (x3hardorder.cc): New.

diff --git a/gcc/testsuite/g++.dg/pph/x0hardorder1.h 
b/gcc/testsuite/g++.dg/pph/x0hardorder1.h
new file mode 100644
index 000..bfb547e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/x0hardorder1.h
@@ -0,0 +1,13 @@
+#ifndef HARD_ORDER_1_H
+#define HARD_ORDER_1_H
+
+int a1 = 1;
+
+namespace N {
+int n1 = 1;
+int m1 = 2;
+}
+
+float b1 = 1.1;
+
+#endif
diff --git a/gcc/testsuite/g++.dg/pph/x3hardorder.cc 
b/gcc/testsuite/g++.dg/pph/x3hardorder.cc
new file mode 100644
index 000..8f62539
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/x3hardorder.cc
@@ -0,0 +1,8 @@
+//pph asm xdiff 28345
+//Ordering of globals is different
+
+#include "x3hardorder2.h"
+
+int test () {
+  return a1 + a2 - b1 + b2 * N::n1 + N::n2 - N::m1 + N::m2;
+}
diff --git a/gcc/testsuite/g++.dg/pph/x3hardorder2.h 
b/gcc/testsuite/g++.dg/pph/x3hardorder2.h
new file mode 100644
index 000..d534ae4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pph/x3hardorder2.h
@@ -0,0 +1,18 @@
+#ifndef HARD_ORDER_2_H
+#define HARD_ORDER_2_H
+
+int a2 = 2;
+
+namespace N {
+int n2 = 3;
+}
+
+#include "x0hardorder1.h"
+
+float b2 = 2.2;
+
+namespace N {
+int m2 = 3;
+}
+
+#endif

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