gcc/gcc5-pr65074-test.patch

28 lines
552 B
Diff

2015-02-16 Jakub Jelinek <jakub@redhat.com>
PR middle-end/65074
* g++.dg/opt/pr65074.C: New test.
--- gcc/testsuite/g++.dg/opt/pr65074.C.jj 2015-02-16 09:53:52.171683872 +0100
+++ gcc/testsuite/g++.dg/opt/pr65074.C 2015-02-16 09:53:24.000000000 +0100
@@ -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");
+}