Check pie_enabled target in PIC tests
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 25 Sep 2018 12:25:44 +0000 (12:25 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 25 Sep 2018 12:25:44 +0000 (05:25 -0700)
We need to check pie_enabled target in PIC tests to support GCC where
PIE is enabled by default when configured with --enable-default-pie.

PR testsuite/70150
* gcc.dg/20020312-2.c (dg-additional-options): Set to "-no-pie"
for pie_enabled target.
* gcc.dg/uninit-19.c: Check pie_enabled for PIC.
* gcc.target/i386/pr34256.c: Likewise.

From-SVN: r264565

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20020312-2.c
gcc/testsuite/gcc.dg/uninit-19.c
gcc/testsuite/gcc.target/i386/pr34256.c

index 224317927cec944c201ef249ca223260a0937eda..af269f425fc12b6df78d20b9e121e9de305c0271 100644 (file)
@@ -1,3 +1,11 @@
+2018-09-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR testsuite/70150
+       * gcc.dg/20020312-2.c (dg-additional-options): Set to "-no-pie"
+       for pie_enabled target.
+       * gcc.dg/uninit-19.c: Check pie_enabled for PIC.
+       * gcc.target/i386/pr34256.c: Likewise.
+
 2018-09-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/85070
index f8be3ce2964c47d61f56ca9f0d5e0ea75a0f08a0..1a8afd81506fdcf7823139b604f73ed6cfad1892 100644 (file)
@@ -7,6 +7,7 @@
 
 /* { dg-do run } */
 /* { dg-options "-O -fno-pic" } */
+/* { dg-additional-options "-no-pie" { target pie_enabled } } */
 /* { dg-require-effective-target nonlocal_goto } */
 
 extern void abort (void);
index 094dc0eb73d5a3fe3bc82fc82e82ca33982ed535..3f5f06af540d0e25c069db40b56437d069bdbfcc 100644 (file)
@@ -12,7 +12,7 @@ fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,
 {
   if (p1 & 8)
     b[3] = p10[a];
-  /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } .-1 } */
+  /* { dg-warning "may be used uninitialized" "" { target { { nonpic || pie_enabled } || { hppa*64*-*-* } } } .-1 } */
 }
 
 void
@@ -22,5 +22,5 @@ fn2 ()
   if (l & 6)
     n = &c + m;
   fn1 (l, &d, &e, &g, &i, &h, &k, n);
-  /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } .-1 } */
+  /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic || pie_enabled } || { hppa*64*-*-* } } } } .-1 } */
 }
index 992312a4f264b140efd178f0f27a2bb16cad2296..698745765d8e1d5ac0a7255d6f4fda7e987f2c87 100644 (file)
@@ -10,5 +10,5 @@ unsigned long long  foo(__m64 m) {
   return _mm_cvtm64_si64(_mm_add_pi32(x, y));
 }
 
-/* { dg-final { scan-assembler-times "mov" 2 { target nonpic } } } */
-/* { dg-final { scan-assembler-times "mov" 4 { target { ! nonpic } } } } */
+/* { dg-final { scan-assembler-times "mov" 2 { target { nonpic || pie_enabled } } } } */
+/* { dg-final { scan-assembler-times "mov" 4 { target { { ! nonpic } && { ! pie_enabled } } } } } */