gcc/testsuite/gcc.dg: Fix pic test case for PE targets

gcc/testsuite/ChangeLog:

	* gcc.dg/pic-2.c: Fix expected __PIC__ value.
	* gcc.dg/pic-3.c: Ditto.
	* gcc.dg/pic-4.c: Ditto.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
This commit is contained in:
Jonathan Yong 2023-02-14 10:37:03 +00:00
parent cd5baeb448
commit 38945ee3b2
3 changed files with 15 additions and 3 deletions

View file

@ -4,7 +4,11 @@
/* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */
/* { dg-skip-if "__PIE__ is always defined for GCN" { amdgcn*-*-* } } */
#if __PIC__ != 2
#if defined(__CYGWIN__) || defined(__WIN32__)
# if __PIC__ != 1
# error __PIC__ is not 1!
# endif
#elif __PIC__ != 2
# error __PIC__ is not 2!
#endif

View file

@ -1,7 +1,11 @@
/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* amdgcn*-*-* } } } } */
/* { dg-options "-fno-pic" } */
#ifdef __PIC__
#if defined(__CYGWIN__) || defined(__WIN32__)
# if __PIC__ != 1
# error __PIC__ is not 1!
# endif
#elif __PIC__
# error __PIC__ is defined!
#endif

View file

@ -1,7 +1,11 @@
/* { dg-do compile { target { ! { *-*-darwin* hppa*64*-*-* mips*-*-linux-* amdgcn*-*-* } } } } */
/* { dg-options "-fno-PIC" } */
#ifdef __PIC__
#if defined(__CYGWIN__) || defined(__WIN32__)
# if __PIC__ != 1
# error __PIC__ is not 1!
# endif
#elif __PIC__
# error __PIC__ is defined!
#endif