Commit ff83f9c8 by Alexander Ivchenko Committed by Kirill Yukhin

safe-3.c: Add bind_pic_locally.

gcc/testsuite
	* c-c++-common/tm/safe-3.c: Add bind_pic_locally.
	* g++.dg/ipa/devirt-15.C: Ditto.
	* g++.dg/ipa/devirt-7.C: Ditto.
	* g++.dg/ipa/pr60600.C: Ditto.
	* g++.dg/opt/vt2.C: Ditto.
	* g++.dg/opt/vt4.C: Ditto.
	* g++.dg/pr48484.C: Ditto.
	* g++.dg/tm/pr47746.C: Ditto.
	* g++.dg/tree-ssa/pr57380.C: Ditto.
	* gcc.dg/ipa/inline-4.c: Ditto.
	* gcc.dg/ipa/inlinehint-1.c: Ditto.
	* gcc.dg/ipa/inlinehint-2.c: Ditto.
	* gcc.dg/ipa/inlinehint-3.c: Ditto.
	* gcc.dg/pr47276.c: Ditto.
	* gcc.dg/pure-2.c: Ditto.
	* gcc.dg/tm/nested-2.c: Ditto.
	* gcc.dg/tree-ssa/alias-29.c: Ditto.
	* gcc.target/i386/3dnow-1.c: Ditto.
	* gcc.target/i386/3dnow-2.c: Ditto.
	* gcc.target/i386/3dnowA-1.c: Ditto.
	* gcc.target/i386/3dnowA-2.c: Ditto.
	* gcc.target/i386/avx-1.c: Ditto.
	* gcc.target/i386/avx-2.c: Ditto.
	* gcc.target/i386/memcpy-1.c: Ditto.
	* gcc.target/i386/mmx-1.c: Ditto.
	* gcc.target/i386/mmx-2.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-22a.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* gcc.target/i386/sse-24.c: Ditto.
	* gcc.target/i386/vect-double-1.c: Ditto.
	* g++.dg/fstack-protector-strong.C: Add target nonpic.
	* gcc.dg/fstack-protector-strong.c: Ditto.

From-SVN: r217704
parent f89e12f2
2014-11-18 Alexander Ivchenko <alexander.ivchenko@intel.com>
* c-c++-common/tm/safe-3.c: Add bind_pic_locally.
* g++.dg/ipa/devirt-15.C: Ditto.
* g++.dg/ipa/devirt-7.C: Ditto.
* g++.dg/ipa/pr60600.C: Ditto.
* g++.dg/opt/vt2.C: Ditto.
* g++.dg/opt/vt4.C: Ditto.
* g++.dg/pr48484.C: Ditto.
* g++.dg/tm/pr47746.C: Ditto.
* g++.dg/tree-ssa/pr57380.C: Ditto.
* gcc.dg/ipa/inline-4.c: Ditto.
* gcc.dg/ipa/inlinehint-1.c: Ditto.
* gcc.dg/ipa/inlinehint-2.c: Ditto.
* gcc.dg/ipa/inlinehint-3.c: Ditto.
* gcc.dg/pr47276.c: Ditto.
* gcc.dg/pure-2.c: Ditto.
* gcc.dg/tm/nested-2.c: Ditto.
* gcc.dg/tree-ssa/alias-29.c: Ditto.
* gcc.target/i386/3dnow-1.c: Ditto.
* gcc.target/i386/3dnow-2.c: Ditto.
* gcc.target/i386/3dnowA-1.c: Ditto.
* gcc.target/i386/3dnowA-2.c: Ditto.
* gcc.target/i386/avx-1.c: Ditto.
* gcc.target/i386/avx-2.c: Ditto.
* gcc.target/i386/memcpy-1.c: Ditto.
* gcc.target/i386/mmx-1.c: Ditto.
* gcc.target/i386/mmx-2.c: Ditto.
* gcc.target/i386/sse-14.c: Ditto.
* gcc.target/i386/sse-22.c: Ditto.
* gcc.target/i386/sse-22a.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/sse-24.c: Ditto.
* gcc.target/i386/vect-double-1.c: Ditto.
* g++.dg/fstack-protector-strong.C: Add target nonpic.
* gcc.dg/fstack-protector-strong.c: Ditto.
2014-11-18 Hale Wang <hale.wang@arm.com> 2014-11-18 Hale Wang <hale.wang@arm.com>
* gcc.target/arm/small-multiply-m0-1.c: Only apply when * gcc.target/arm/small-multiply-m0-1.c: Only apply when
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fgnu-tm" } */ /* { dg-options "-fgnu-tm" } */
/* { dg-add-options bind_pic_locally } */
void f_extern (void); void f_extern (void);
void f_first (void); void f_first (void);
......
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2 -fstack-protector-strong" } */ /* { dg-options "-O2 -fstack-protector-strong" } */
/* This test checks the presence of __stack_chk_fail function in assembler.
* Compiler generates _stack_chk_fail_local (wrapper) calls instead for PIC.
*/
/* { dg-require-effective-target nonpic } */
class A class A
{ {
public: public:
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
A is noreturn. */ A is noreturn. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-devirt-details -fdump-tree-optimized" } */ /* { dg-options "-O2 -fdump-ipa-devirt-details -fdump-tree-optimized" } */
/* { dg-add-options bind_pic_locally } */
class A { class A {
public: public:
virtual int foo(void) virtual int foo(void)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
comes from a method that has been early-inlined into a descendant. */ comes from a method that has been early-inlined into a descendant. */
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O3 -fdump-ipa-cp" } */ /* { dg-options "-O3 -fdump-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
extern "C" void abort (void); extern "C" void abort (void);
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O3 -fdump-ipa-cp" } */ /* { dg-options "-O3 -fdump-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
struct data { struct data {
data(int); data(int);
......
// PR c++/34949 // PR c++/34949
// { dg-options "-O3" } // { dg-options "-O3" }
// { dg-add-options bind_pic_locally }
// { dg-final { scan-assembler-not "mov\[^\n\]*_ZTV" { target i?86-*-* x86_64-*-* } } } // { dg-final { scan-assembler-not "mov\[^\n\]*_ZTV" { target i?86-*-* x86_64-*-* } } }
class Foo class Foo
......
// PR c++/50243 // PR c++/50243
// { dg-do compile } // { dg-do compile }
// { dg-options "-O" } // { dg-options "-O" }
// { dg-add-options bind_pic_locally }
// { dg-final { scan-assembler-not "_ZTV.A" } } // { dg-final { scan-assembler-not "_ZTV.A" } }
void foo (); void foo ();
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -finline-functions -finline-small-functions -Wuninitialized" } */ /* { dg-options "-O -finline-functions -finline-small-functions -Wuninitialized" } */
/* { dg-add-options bind_pic_locally } */
struct SQObjectPtr struct SQObjectPtr
{ {
......
// { dg-do compile } // { dg-do compile }
// { dg-options "-fgnu-tm" } // { dg-options "-fgnu-tm" }
/* { dg-add-options bind_pic_locally } */
class InputStream class InputStream
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-phiopt1" } */ /* { dg-options "-O2 -fdump-tree-phiopt1" } */
/* { dg-add-options bind_pic_locally } */
struct my_array { struct my_array {
int data[4]; int data[4];
......
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* rs6000-*-* s390x-*-* } } */ /* { dg-do compile { target i?86-*-* x86_64-*-* rs6000-*-* s390x-*-* } } */
/* { dg-options "-O2 -fstack-protector-strong" } */ /* { dg-options "-O2 -fstack-protector-strong" } */
/* This test checks the presence of __stack_chk_fail function in assembler.
* Compiler generates _stack_chk_fail_local (wrapper) calls instead for PIC.
*/
/* { dg-require-effective-target nonpic } */
#include<string.h> #include<string.h>
extern int g0; extern int g0;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */ /* { dg-options "-Os -c -fdump-ipa-inline -fno-early-inlining -fno-partial-inlining -fno-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
void work_hard (void); void work_hard (void);
......
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */ /* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
void test2 (int); void test2 (int);
int int
test (int a) test (int a)
......
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */ /* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
int int
t(int s, void **p) t(int s, void **p)
{ {
......
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */ /* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp" } */
/* { dg-add-options bind_pic_locally } */
void abort (void); void abort (void);
int scc_entry (int); int scc_entry (int);
int sum; int sum;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-require-alias "" } */ /* { dg-require-alias "" } */
/* { dg-require-visibility "" } */ /* { dg-require-visibility "" } */
/* { dg-add-options bind_pic_locally } */
#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
#define ASMNAME2(prefix, cname) STRING (prefix) cname #define ASMNAME2(prefix, cname) STRING (prefix) cname
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -Wsuggest-attribute=pure" } */ /* { dg-options "-O2 -Wsuggest-attribute=pure" } */
/* { dg-add-options bind_pic_locally } */
extern int extern_const(int a) __attribute__ ((pure)); extern int extern_const(int a) __attribute__ ((pure));
extern int v; extern int v;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fgnu-tm" } */ /* { dg-options "-fgnu-tm" } */
/* { dg-add-options bind_pic_locally } */
void foobar(void) void foobar(void)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */ /* { dg-options "-O -fdump-tree-optimized" } */
/* { dg-add-options bind_pic_locally } */
union X { union X {
int i; int i;
......
/* { dg-do assemble } */ /* { dg-do assemble } */
/* { dg-require-effective-target 3dnow } */ /* { dg-require-effective-target 3dnow } */
/* { dg-options "-O2 -Werror-implicit-function-declaration -m3dnow" } */ /* { dg-options "-O2 -Werror-implicit-function-declaration -m3dnow" } */
/* { dg-add-options bind_pic_locally } */
/* Test that the intrinsics compile with optimization. All of them are /* Test that the intrinsics compile with optimization. All of them are
defined as inline functions in mmintrin.h that reference the proper defined as inline functions in mmintrin.h that reference the proper
......
/* { dg-do assemble } */ /* { dg-do assemble } */
/* { dg-require-effective-target 3dnow } */ /* { dg-require-effective-target 3dnow } */
/* { dg-options "-O0 -Werror-implicit-function-declaration -m3dnow" } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -m3dnow" } */
/* { dg-add-options bind_pic_locally } */
/* Test that the intrinsics compile without optimization. All of them are /* Test that the intrinsics compile without optimization. All of them are
defined as inline functions in mmintrin.h that reference the proper defined as inline functions in mmintrin.h that reference the proper
......
/* { dg-do assemble } */ /* { dg-do assemble } */
/* { dg-require-effective-target 3dnow } */ /* { dg-require-effective-target 3dnow } */
/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow" } */ /* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow" } */
/* { dg-add-options bind_pic_locally } */
/* Test that the intrinsics compile with optimization. All of them are /* Test that the intrinsics compile with optimization. All of them are
defined as inline functions in mmintrin.h that reference the proper defined as inline functions in mmintrin.h that reference the proper
......
/* { dg-do assemble } */ /* { dg-do assemble } */
/* { dg-require-effective-target 3dnow } */ /* { dg-require-effective-target 3dnow } */
/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow" } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow" } */
/* { dg-add-options bind_pic_locally } */
/* Test that the intrinsics compile without optimization. All of them are /* Test that the intrinsics compile without optimization. All of them are
defined as inline functions in mmintrin.h that reference the proper defined as inline functions in mmintrin.h that reference the proper
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mavx2 -maes -mpclmul" } */ /* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mavx2 -maes -mpclmul" } */
/* { dg-add-options bind_pic_locally } */
#include <mm_malloc.h> #include <mm_malloc.h>
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mavx2 -msse4a -maes -mpclmul" } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -mavx2 -msse4a -maes -mpclmul" } */
/* { dg-add-options bind_pic_locally } */
#include <mm_malloc.h> #include <mm_malloc.h>
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-require-effective-target ia32 } */ /* { dg-require-effective-target ia32 } */
/* { dg-options "-O2 -march=pentiumpro -minline-all-stringops -fno-common" } */ /* { dg-options "-O2 -march=pentiumpro -minline-all-stringops -fno-common" } */
/* { dg-add-options bind_pic_locally } */
/* { dg-final { scan-assembler "rep" } } */ /* { dg-final { scan-assembler "rep" } } */
/* { dg-final { scan-assembler "movs" } } */ /* { dg-final { scan-assembler "movs" } } */
/* { dg-final { scan-assembler-not "test" } } */ /* { dg-final { scan-assembler-not "test" } } */
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-do compile { target { nonpic } } } */
/* { dg-options "-O2 -Werror-implicit-function-declaration -mmmx" } */ /* { dg-options "-O2 -Werror-implicit-function-declaration -mmmx" } */
/* { dg-add-options bind_pic_locally } */
/* Test that the intrinsics compile with optimization. All of them are /* Test that the intrinsics compile with optimization. All of them are
defined as inline functions in mmintrin.h that reference the proper defined as inline functions in mmintrin.h that reference the proper
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O0 -Werror-implicit-function-declaration -mmmx" } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -mmmx" } */
/* { dg-add-options bind_pic_locally } */
/* Test that the intrinsics compile without optimization. All of them are /* Test that the intrinsics compile without optimization. All of them are
defined as inline functions in mmintrin.h that reference the proper defined as inline functions in mmintrin.h that reference the proper
builtin functions. Defining away "extern" and "__inline" results in builtin functions. Defining away "extern" and "__inline" results in
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl" } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma -mrtm -mrdseed -mprfchw -madx -mfxsr -mxsaveopt -mavx512f -mavx512er -mavx512cd -mavx512pf -msha -mprefetchwt1 -mxsavec -mxsaves -mclflushopt -mavx512dq -mavx512bw -mavx512vl" } */
/* { dg-add-options bind_pic_locally } */
#include <mm_malloc.h> #include <mm_malloc.h>
......
/* Same as sse-14, except converted to use #pragma GCC option. */ /* Same as sse-14, except converted to use #pragma GCC option. */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8" } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8" } */
/* { dg-add-options bind_pic_locally } */
#include <mm_malloc.h> #include <mm_malloc.h>
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8" } */ /* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8" } */
/* { dg-add-options bind_pic_locally } */
#define DIFFERENT_PRAGMAS #define DIFFERENT_PRAGMAS
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8" } */ /* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8" } */
/* { dg-add-options bind_pic_locally } */
#include <mm_malloc.h> #include <mm_malloc.h>
......
/* PR target/44338 */ /* PR target/44338 */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -ffp-contract=off" } */ /* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -ffp-contract=off" } */
/* { dg-add-options bind_pic_locally } */
#include "sse-23.c" #include "sse-23.c"
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-march=*" } { "-march=core2" } } */ /* { dg-skip-if "" { *-*-* } { "-march=*" } { "-march=core2" } } */
/* { dg-options "-O2 -ftree-vectorize -mfpmath=sse -march=core2 -fdump-tree-vect-stats" } */ /* { dg-options "-O2 -ftree-vectorize -mfpmath=sse -march=core2 -fdump-tree-vect-stats" } */
/* { dg-add-options bind_pic_locally } */
extern void abort (void); extern void abort (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment