public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [testsuite] Adding -fno-pic to certain tests
@ 2013-01-10 13:50 Alexander Ivchenko
  2013-01-10 14:01 ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Ivchenko @ 2013-01-10 13:50 UTC (permalink / raw)
  To: GCC Patches, Maxim Kuvyrkov, pavel.v.chupin, H.J. Lu

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

Hi,

It all begun with discussion here
 http://gcc.gnu.org/ml/gcc/2012-11/msg00205.html

Since -fpic option is turned on by default in Android we have certain test
fails. The reason for that is that those tests rely on the
availability of functions, defined in them
and with -fpic compiler conservatively assumes that they are AVAIL_OVERWRITABLE.

The attached patch adding -fno-pic option for tests that fail because of that.

2013-01-10  Alexander Ivchenko  <alexander.ivchenko@intel.com>

       * g++.dg/ipa/ivinline-1.C: Add -fno-pic option.
       * g++.dg/ipa/ivinline-2.C: Likewise.
       * g++.dg/ipa/ivinline-3.C: Likewise.
       * g++.dg/ipa/ivinline-4.C: Likewise.
       * g++.dg/ipa/ivinline-5.C: Likewise.
       * g++.dg/ipa/ivinline-7.C: Likewise.
       * g++.dg/ipa/ivinline-8.C: Likewise.
       * g++.dg/ipa/ivinline-9.C: Likewise.
       * g++.dg/cpp0x/noexcept03.C: Likewise.
       * gcc.dg/const-1.c: Likewise.
       * gcc.dg/ipa/pure-const-1.c: Likewise.
       * gcc.dg/noreturn-8.c: Likewise.
       * gcc.dg/tree-ssa/ipa-split-5.c: Likewise.
       * gcc.dg/tree-ssa/loadpre6.c: Likewise.
       * gcc.c-torture/execute/pr33992.c: Likewise.
       * gcc.c-torture/execute/pr33992.x: New file.

ok for mainline?

thanks,
Alexander

[-- Attachment #2: adding_fno_pic.patch --]
[-- Type: application/octet-stream, Size: 9082 bytes --]

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3a3e46a..e1375cf 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,22 @@
+2013-01-10  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+	* g++.dg/ipa/ivinline-1.C: Add -fno-pic option.
+	* g++.dg/ipa/ivinline-2.C: Likewise.
+	* g++.dg/ipa/ivinline-3.C: Likewise.
+	* g++.dg/ipa/ivinline-4.C: Likewise.
+	* g++.dg/ipa/ivinline-5.C: Likewise.
+	* g++.dg/ipa/ivinline-7.C: Likewise.
+	* g++.dg/ipa/ivinline-8.C: Likewise.
+	* g++.dg/ipa/ivinline-9.C: Likewise.
+	* g++.dg/cpp0x/noexcept03.C: Likewise.
+	* gcc.dg/const-1.c: Likewise.
+	* gcc.dg/ipa/pure-const-1.c: Likewise.
+	* gcc.dg/noreturn-8.c: Likewise.
+	* gcc.dg/tree-ssa/ipa-split-5.c: Likewise.
+	* gcc.dg/tree-ssa/loadpre6.c: Likewise.
+	* gcc.c-torture/execute/pr33992.c: Likewise.
+	* gcc.c-torture/execute/pr33992.x: New file.
+
 2013-01-09  Andreas Schwab  <schwab@suse.de>
 
 	* gcc.dg/guality/pr54693.c: Null-terminate arr.
@@ -20,7 +39,7 @@
 
 2013-01-08  Tejas Belagod  <tejas.belagod@arm.com>
 
-	* gcc.target/aarch64/vect-mull-compile.c: Explicitly scan for 
+	* gcc.target/aarch64/vect-mull-compile.c: Explicitly scan for
 	instructions generated instead of number of occurances.
 
 2013-01-08  James Greenhalgh  <james.greenhalgh@arm.com>
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C
index 54e04f3..bdb7eed 100644
--- a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C
@@ -1,5 +1,5 @@
 // Runtime test for noexcept-specification.
-// { dg-options "-std=c++0x -Wnoexcept" }
+// { dg-options "-std=c++0x -Wnoexcept -fno-pic" }
 // { dg-do run }
 
 #include <exception>
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-1.C b/gcc/testsuite/g++.dg/ipa/ivinline-1.C
index fc63e60..f439b3c 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-1.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-1.C
@@ -1,7 +1,7 @@
 /* Verify that simple virtual calls are inlined even without early
    inlining.  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-2.C b/gcc/testsuite/g++.dg/ipa/ivinline-2.C
index f993303..a8272c5 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-2.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-2.C
@@ -1,7 +1,7 @@
 /* Verify that simple virtual calls using this pointer are inlined
    even without early inlining..  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-3.C b/gcc/testsuite/g++.dg/ipa/ivinline-3.C
index d9a47f8..4b93315 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-3.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-3.C
@@ -1,7 +1,7 @@
 /* Verify that simple virtual calls on an object refrence are inlined
    even without early inlining.  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-4.C b/gcc/testsuite/g++.dg/ipa/ivinline-4.C
index 93cbe0c..53a8206 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-4.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-4.C
@@ -2,7 +2,7 @@
    inlining, even when a typecast to an ancestor is involved along the
    way.  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-5.C b/gcc/testsuite/g++.dg/ipa/ivinline-5.C
index 91e8f4e..5d86c59 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-5.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-5.C
@@ -1,7 +1,7 @@
 /* Verify that virtual call inlining does not pick a wrong method when
    there is a user defined ancestor in an object.  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-7.C b/gcc/testsuite/g++.dg/ipa/ivinline-7.C
index 2630dff..41bf0a9 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-7.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-7.C
@@ -2,7 +2,7 @@
    inlining, even when a typecast to an ancestor is involved along the
    way and that ancestor is not the first one with virtual functions.  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-8.C b/gcc/testsuite/g++.dg/ipa/ivinline-8.C
index 3bdf4c1..8810cd1 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-8.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-8.C
@@ -1,7 +1,7 @@
 /* Verify that virtual calls are inlined (ithout early inlining) even
    when their caller is itself indirectly inlined.  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-9.C b/gcc/testsuite/g++.dg/ipa/ivinline-9.C
index 4ff07a9..018c905 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-9.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-9.C
@@ -3,7 +3,7 @@
    way and that ancestor itself has an ancestor wich is not the
    primary base class.  */
 /* { dg-do run } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
+/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp -fno-pic"  } */
 
 extern "C" void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr33992.c b/gcc/testsuite/gcc.c-torture/execute/pr33992.c
index 7433610..0d7e0ab 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr33992.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr33992.c
@@ -1,3 +1,4 @@
+/* { dg-options "-fno-pic" } */
 extern void abort ();
 
 void __attribute__((noinline))
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr33992.x b/gcc/testsuite/gcc.c-torture/execute/pr33992.x
new file mode 100644
index 0000000..d419c50
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr33992.x
@@ -0,0 +1,2 @@
+set additional_flags "-fno-pic"
+return 0
diff --git a/gcc/testsuite/gcc.dg/const-1.c b/gcc/testsuite/gcc.dg/const-1.c
index 2a532f8..447292b 100644
--- a/gcc/testsuite/gcc.dg/const-1.c
+++ b/gcc/testsuite/gcc.dg/const-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wsuggest-attribute=const" } */
+/* { dg-options "-O2 -Wsuggest-attribute=const -fno-pic" } */
 
 extern int extern_const(int a) __attribute__ ((const));
 
diff --git a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
index 51837ea..43b16a1 100644
--- a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining" } */
+/* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining -fno-pic" } */
 void abort (void);
 int error_code;
 static int val;
diff --git a/gcc/testsuite/gcc.dg/noreturn-8.c b/gcc/testsuite/gcc.dg/noreturn-8.c
index 50765da..c7012a9 100644
--- a/gcc/testsuite/gcc.dg/noreturn-8.c
+++ b/gcc/testsuite/gcc.dg/noreturn-8.c
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fno-pic" } */
 void exit (int);
 void noreturn_autodetection_failed ();
 __attribute__ ((noinline))
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
index bf07149..d0d8a8f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized" } */
+/* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized -fno-pic" } */
 
 struct a {int a,b;};
 struct a make_me_big (int a);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
index 6fc2a57..7ba1aea 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */
+/* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1 -fno-pic" } */
 #include <stddef.h>
 
 union tree_node;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [testsuite] Adding -fno-pic to certain tests
  2013-01-10 13:50 [testsuite] Adding -fno-pic to certain tests Alexander Ivchenko
@ 2013-01-10 14:01 ` Richard Biener
  2013-03-24  6:49   ` Alexander Ivchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2013-01-10 14:01 UTC (permalink / raw)
  To: Alexander Ivchenko; +Cc: GCC Patches, Maxim Kuvyrkov, pavel.v.chupin, H.J. Lu

On Thu, Jan 10, 2013 at 2:50 PM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
> Hi,
>
> It all begun with discussion here
>  http://gcc.gnu.org/ml/gcc/2012-11/msg00205.html
>
> Since -fpic option is turned on by default in Android we have certain test
> fails. The reason for that is that those tests rely on the
> availability of functions, defined in them
> and with -fpic compiler conservatively assumes that they are AVAIL_OVERWRITABLE.
>
> The attached patch adding -fno-pic option for tests that fail because of that.

I think this should be a dg-requires nopic instead.  Otherwise testing
with -fPIC/-fno-pic will not show expected differences.

Richard.

> 2013-01-10  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>
>        * g++.dg/ipa/ivinline-1.C: Add -fno-pic option.
>        * g++.dg/ipa/ivinline-2.C: Likewise.
>        * g++.dg/ipa/ivinline-3.C: Likewise.
>        * g++.dg/ipa/ivinline-4.C: Likewise.
>        * g++.dg/ipa/ivinline-5.C: Likewise.
>        * g++.dg/ipa/ivinline-7.C: Likewise.
>        * g++.dg/ipa/ivinline-8.C: Likewise.
>        * g++.dg/ipa/ivinline-9.C: Likewise.
>        * g++.dg/cpp0x/noexcept03.C: Likewise.
>        * gcc.dg/const-1.c: Likewise.
>        * gcc.dg/ipa/pure-const-1.c: Likewise.
>        * gcc.dg/noreturn-8.c: Likewise.
>        * gcc.dg/tree-ssa/ipa-split-5.c: Likewise.
>        * gcc.dg/tree-ssa/loadpre6.c: Likewise.
>        * gcc.c-torture/execute/pr33992.c: Likewise.
>        * gcc.c-torture/execute/pr33992.x: New file.
>
> ok for mainline?
>
> thanks,
> Alexander

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [testsuite] Adding -fno-pic to certain tests
  2013-01-10 14:01 ` Richard Biener
@ 2013-03-24  6:49   ` Alexander Ivchenko
  2013-03-25  9:29     ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Ivchenko @ 2013-03-24  6:49 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Maxim Kuvyrkov

[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]

Hi,

Finally got my hands on that: the attached patch adds the
"target nonpic" for those tests that require the avaiability of
functions defined in them.

OK for trunk?

thanks,
Alexander


2013/1/10 Richard Biener <richard.guenther@gmail.com>:
> On Thu, Jan 10, 2013 at 2:50 PM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
>> Hi,
>>
>> It all begun with discussion here
>>  http://gcc.gnu.org/ml/gcc/2012-11/msg00205.html
>>
>> Since -fpic option is turned on by default in Android we have certain test
>> fails. The reason for that is that those tests rely on the
>> availability of functions, defined in them
>> and with -fpic compiler conservatively assumes that they are AVAIL_OVERWRITABLE.
>>
>> The attached patch adding -fno-pic option for tests that fail because of that.
>
> I think this should be a dg-requires nopic instead.  Otherwise testing
> with -fPIC/-fno-pic will not show expected differences.
>
> Richard.
>
>> 2013-01-10  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>>
>>        * g++.dg/ipa/ivinline-1.C: Add -fno-pic option.
>>        * g++.dg/ipa/ivinline-2.C: Likewise.
>>        * g++.dg/ipa/ivinline-3.C: Likewise.
>>        * g++.dg/ipa/ivinline-4.C: Likewise.
>>        * g++.dg/ipa/ivinline-5.C: Likewise.
>>        * g++.dg/ipa/ivinline-7.C: Likewise.
>>        * g++.dg/ipa/ivinline-8.C: Likewise.
>>        * g++.dg/ipa/ivinline-9.C: Likewise.
>>        * g++.dg/cpp0x/noexcept03.C: Likewise.
>>        * gcc.dg/const-1.c: Likewise.
>>        * gcc.dg/ipa/pure-const-1.c: Likewise.
>>        * gcc.dg/noreturn-8.c: Likewise.
>>        * gcc.dg/tree-ssa/ipa-split-5.c: Likewise.
>>        * gcc.dg/tree-ssa/loadpre6.c: Likewise.
>>        * gcc.c-torture/execute/pr33992.c: Likewise.
>>        * gcc.c-torture/execute/pr33992.x: New file.
>>
>> ok for mainline?
>>
>> thanks,
>> Alexander

[-- Attachment #2: adding_fno_pic_02.patch --]
[-- Type: application/octet-stream, Size: 8682 bytes --]

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 72f436e..8f5cc29 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,22 @@
+2013-03-22  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+	* g++.dg/ipa/ivinline-1.C: Add target nonpic.
+	* g++.dg/ipa/ivinline-2.C: Likewise.
+	* g++.dg/ipa/ivinline-3.C: Likewise.
+	* g++.dg/ipa/ivinline-4.C: Likewise.
+	* g++.dg/ipa/ivinline-5.C: Likewise.
+	* g++.dg/ipa/ivinline-7.C: Likewise.
+	* g++.dg/ipa/ivinline-8.C: Likewise.
+	* g++.dg/ipa/ivinline-9.C: Likewise.
+	* g++.dg/cpp0x/noexcept03.C: Likewise.
+	* gcc.dg/const-1.c: Likewise.
+	* gcc.dg/ipa/pure-const-1.c: Likewise.
+	* gcc.dg/noreturn-8.c: Likewise.
+	* gcc.dg/tree-ssa/ipa-split-5.c: Likewise.
+	* gcc.dg/tree-ssa/loadpre6.c: Likewise.
+	* gcc.c-torture/execute/pr33992.x: New file.
+	* gcc.target/i386/mmx-1.c: Add -fno-pic option for Android.
+
 2013-03-20  Tilo Schwarz  <tilo@tilo-schwarz.de>
 
 	PR libfortran/51825
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C
index 54e04f3..41c442e 100644
--- a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C
@@ -1,6 +1,6 @@
 // Runtime test for noexcept-specification.
 // { dg-options "-std=c++0x -Wnoexcept" }
-// { dg-do run }
+// { dg-do run { target nonpic } }
 
 #include <exception>
 #include <cstdlib>
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-1.C b/gcc/testsuite/g++.dg/ipa/ivinline-1.C
index fc63e60..bc4dfea 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-1.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-1.C
@@ -1,6 +1,6 @@
 /* Verify that simple virtual calls are inlined even without early
    inlining.  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-2.C b/gcc/testsuite/g++.dg/ipa/ivinline-2.C
index f993303..001cff2 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-2.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-2.C
@@ -1,6 +1,6 @@
 /* Verify that simple virtual calls using this pointer are inlined
    even without early inlining..  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-3.C b/gcc/testsuite/g++.dg/ipa/ivinline-3.C
index d9a47f8..637a6ae 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-3.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-3.C
@@ -1,6 +1,6 @@
 /* Verify that simple virtual calls on an object refrence are inlined
    even without early inlining.  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-4.C b/gcc/testsuite/g++.dg/ipa/ivinline-4.C
index 93cbe0c..f5b8f8e 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-4.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-4.C
@@ -1,7 +1,7 @@
 /* Verify that simple virtual calls are inlined even without early
    inlining, even when a typecast to an ancestor is involved along the
    way.  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-5.C b/gcc/testsuite/g++.dg/ipa/ivinline-5.C
index 91e8f4e..d78173d 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-5.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-5.C
@@ -1,6 +1,6 @@
 /* Verify that virtual call inlining does not pick a wrong method when
    there is a user defined ancestor in an object.  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-7.C b/gcc/testsuite/g++.dg/ipa/ivinline-7.C
index 2630dff..9d725a5 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-7.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-7.C
@@ -1,7 +1,7 @@
 /* Verify that simple virtual calls are inlined even without early
    inlining, even when a typecast to an ancestor is involved along the
    way and that ancestor is not the first one with virtual functions.  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-8.C b/gcc/testsuite/g++.dg/ipa/ivinline-8.C
index 3bdf4c1..eebfc6a 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-8.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-8.C
@@ -1,6 +1,6 @@
 /* Verify that virtual calls are inlined (ithout early inlining) even
    when their caller is itself indirectly inlined.  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-9.C b/gcc/testsuite/g++.dg/ipa/ivinline-9.C
index 4ff07a9..586c3af 100644
--- a/gcc/testsuite/g++.dg/ipa/ivinline-9.C
+++ b/gcc/testsuite/g++.dg/ipa/ivinline-9.C
@@ -2,7 +2,7 @@
    inlining, even when a typecast to an ancestor is involved along the
    way and that ancestor itself has an ancestor wich is not the
    primary base class.  */
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
 
 extern "C" void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr33992.x b/gcc/testsuite/gcc.c-torture/execute/pr33992.x
new file mode 100644
index 0000000..57e9840
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr33992.x
@@ -0,0 +1,7 @@
+load_lib target-supports.exp
+
+if { [ check_effective_target_nonpic ] } {
+        return 0
+}
+
+return 1
diff --git a/gcc/testsuite/gcc.dg/const-1.c b/gcc/testsuite/gcc.dg/const-1.c
index 2a532f8..a5b2b16 100644
--- a/gcc/testsuite/gcc.dg/const-1.c
+++ b/gcc/testsuite/gcc.dg/const-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target nonpic } } */
 /* { dg-options "-O2 -Wsuggest-attribute=const" } */
 
 extern int extern_const(int a) __attribute__ ((const));
diff --git a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
index 51837ea..f76dd87 100644
--- a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target nonpic } } */
 /* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining" } */
 void abort (void);
 int error_code;
diff --git a/gcc/testsuite/gcc.dg/noreturn-8.c b/gcc/testsuite/gcc.dg/noreturn-8.c
index 50765da..1e75633 100644
--- a/gcc/testsuite/gcc.dg/noreturn-8.c
+++ b/gcc/testsuite/gcc.dg/noreturn-8.c
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target nonpic } } */
 /* { dg-options "-O2" } */
 void exit (int);
 void noreturn_autodetection_failed ();
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
index bf07149..abf1e07 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target nonpic } } */
 /* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized" } */
 
 struct a {int a,b;};
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
index 6fc2a57..bcd72c5 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */ 
+/* { dg-do compile { target nonpic } } */
 /* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */
 #include <stddef.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/mmx-1.c b/gcc/testsuite/gcc.target/i386/mmx-1.c
index 0b31a53..8ae5fa3 100644
--- a/gcc/testsuite/gcc.target/i386/mmx-1.c
+++ b/gcc/testsuite/gcc.target/i386/mmx-1.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Werror-implicit-function-declaration -mmmx" } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -mmmx" { target { ! *-*-android* } } } */
+/* { dg-options "-O2 -Werror-implicit-function-declaration -mmmx -fno-pic" { target { *-*-android* } } } */
 
 /* Test that the intrinsics compile with optimization.  All of them are
    defined as inline functions in mmintrin.h that reference the proper

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [testsuite] Adding -fno-pic to certain tests
  2013-03-24  6:49   ` Alexander Ivchenko
@ 2013-03-25  9:29     ` Richard Biener
  2013-03-27 10:02       ` Kirill Yukhin
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2013-03-25  9:29 UTC (permalink / raw)
  To: Alexander Ivchenko; +Cc: GCC Patches, Maxim Kuvyrkov

On Sun, Mar 24, 2013 at 7:49 AM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
> Hi,
>
> Finally got my hands on that: the attached patch adds the
> "target nonpic" for those tests that require the avaiability of
> functions defined in them.
>
> OK for trunk?

For testsuite/gcc.target/i386/mmx-1.c you still don't use nopic.
Please fix that.

Ok with that change.

Thanks,
Richard.

> thanks,
> Alexander
>
>
> 2013/1/10 Richard Biener <richard.guenther@gmail.com>:
>> On Thu, Jan 10, 2013 at 2:50 PM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
>>> Hi,
>>>
>>> It all begun with discussion here
>>>  http://gcc.gnu.org/ml/gcc/2012-11/msg00205.html
>>>
>>> Since -fpic option is turned on by default in Android we have certain test
>>> fails. The reason for that is that those tests rely on the
>>> availability of functions, defined in them
>>> and with -fpic compiler conservatively assumes that they are AVAIL_OVERWRITABLE.
>>>
>>> The attached patch adding -fno-pic option for tests that fail because of that.
>>
>> I think this should be a dg-requires nopic instead.  Otherwise testing
>> with -fPIC/-fno-pic will not show expected differences.
>>
>> Richard.
>>
>>> 2013-01-10  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>>>
>>>        * g++.dg/ipa/ivinline-1.C: Add -fno-pic option.
>>>        * g++.dg/ipa/ivinline-2.C: Likewise.
>>>        * g++.dg/ipa/ivinline-3.C: Likewise.
>>>        * g++.dg/ipa/ivinline-4.C: Likewise.
>>>        * g++.dg/ipa/ivinline-5.C: Likewise.
>>>        * g++.dg/ipa/ivinline-7.C: Likewise.
>>>        * g++.dg/ipa/ivinline-8.C: Likewise.
>>>        * g++.dg/ipa/ivinline-9.C: Likewise.
>>>        * g++.dg/cpp0x/noexcept03.C: Likewise.
>>>        * gcc.dg/const-1.c: Likewise.
>>>        * gcc.dg/ipa/pure-const-1.c: Likewise.
>>>        * gcc.dg/noreturn-8.c: Likewise.
>>>        * gcc.dg/tree-ssa/ipa-split-5.c: Likewise.
>>>        * gcc.dg/tree-ssa/loadpre6.c: Likewise.
>>>        * gcc.c-torture/execute/pr33992.c: Likewise.
>>>        * gcc.c-torture/execute/pr33992.x: New file.
>>>
>>> ok for mainline?
>>>
>>> thanks,
>>> Alexander

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [testsuite] Adding -fno-pic to certain tests
  2013-03-25  9:29     ` Richard Biener
@ 2013-03-27 10:02       ` Kirill Yukhin
  2013-03-27 11:12         ` Alexander Ivchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Kirill Yukhin @ 2013-03-27 10:02 UTC (permalink / raw)
  To: Richard Biener; +Cc: Alexander Ivchenko, GCC Patches, Maxim Kuvyrkov

> Ok with that change.

Checked into trunk: http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00786.html

Thanks, K

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [testsuite] Adding -fno-pic to certain tests
  2013-03-27 10:02       ` Kirill Yukhin
@ 2013-03-27 11:12         ` Alexander Ivchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Ivchenko @ 2013-03-27 11:12 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches

Hi,

Thank you for your review. Since the patch was aimed to fix tests
and it is pretty small, is it posible to backport it to 4.8 branch? So we
would not have those testfails on Android with new release.


Alexander

2013/3/27 Kirill Yukhin <kirill.yukhin@gmail.com>:
>> Ok with that change.
>
> Checked into trunk: http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00786.html
>
> Thanks, K

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-27 11:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-10 13:50 [testsuite] Adding -fno-pic to certain tests Alexander Ivchenko
2013-01-10 14:01 ` Richard Biener
2013-03-24  6:49   ` Alexander Ivchenko
2013-03-25  9:29     ` Richard Biener
2013-03-27 10:02       ` Kirill Yukhin
2013-03-27 11:12         ` Alexander Ivchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).