re PR middle-end/65074 (r220674 broke C++ PIEs)
authorJakub Jelinek <jakub@redhat.com>
Thu, 19 Feb 2015 15:48:50 +0000 (16:48 +0100)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 19 Feb 2015 15:48:50 +0000 (07:48 -0800)
PR middle-end/65074

 * g++.dg/opt/pr65074.C: New file.

From-SVN: r220817

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr65074.C [new file with mode: 0644]

index a2ca2c867169ce21c14d64a37c7f5b68dece4fdb..65303b19ede7070ecab4d06923d9bc46e3df43f5 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/65074
+       * g++.dg/opt/pr65074.C: New file.
+
 2015-02-19  Andrea Azzarone  <azzaronea@gmail.com>
 
        * g++.dg/cpp1y/udlit-char-template-vs-std-literal-operator.C
diff --git a/gcc/testsuite/g++.dg/opt/pr65074.C b/gcc/testsuite/g++.dg/opt/pr65074.C
new file mode 100644 (file)
index 0000000..01c5926
--- /dev/null
@@ -0,0 +1,19 @@
+// PR middle-end/65074
+// { dg-do link { target pie } }
+// { dg-options "-pie -fpie -O2" }
+
+#include <fstream>
+
+using namespace std;
+
+__attribute__((noinline, noclone)) void
+foo (const char *fname)
+{
+  ifstream f (fname);
+}
+
+int
+main ()
+{
+  foo ("foobar");
+}