From: Martin Sebor Date: Wed, 20 Sep 2017 22:19:53 +0000 (+0000) Subject: Fix testsuite fallout from r252976. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f2fd590311e5ff636404de6771a7b0dbb8f788d;p=gcc.git Fix testsuite fallout from r252976. gcc/testsuite/ChangeLog: PR c/81854 * gcc.dg/attr-ifunc-1.c: Correct type errors. * gcc.dg/attr-ifunc-2.c: Ditto. * gcc.dg/attr-ifunc-3.c: Ditto. * gcc.dg/attr-ifunc-4.c: Ditto. * gcc.dg/attr-ifunc-5.c: Ditto. * gcc.dg/pr81854.c: Require ifunc support. * gcc/testsuite/lib/target-supports.exp: Correct type error. From-SVN: r253037 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a636327cd93..fd89f9ec878 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2017-09-20 Martin Sebor + + PR c/81854 + * gcc.dg/attr-ifunc-1.c: Correct type errors. + * gcc.dg/attr-ifunc-2.c: Ditto. + * gcc.dg/attr-ifunc-3.c: Ditto. + * gcc.dg/attr-ifunc-4.c: Ditto. + * gcc.dg/attr-ifunc-5.c: Ditto. + * gcc.dg/pr81854.c: Require ifunc support. + * gcc/testsuite/lib/target-supports.exp: Correct type error. + 2017-09-20 Jeff Law * gcc.target/i386/stack-check-11.c: Update test and regexp diff --git a/gcc/testsuite/gcc.dg/attr-ifunc-1.c b/gcc/testsuite/gcc.dg/attr-ifunc-1.c index 3f7450e2c69..f1a19866563 100644 --- a/gcc/testsuite/gcc.dg/attr-ifunc-1.c +++ b/gcc/testsuite/gcc.dg/attr-ifunc-1.c @@ -2,15 +2,13 @@ /* { dg-require-ifunc "" } */ /* { dg-options "" } */ -typedef int F (void); - static int implementation (void) { __builtin_printf ("'ere I am JH\n"); return 0; } -static F* resolver (void) +static __typeof__ (implementation)* resolver (void) { return implementation; } diff --git a/gcc/testsuite/gcc.dg/attr-ifunc-2.c b/gcc/testsuite/gcc.dg/attr-ifunc-2.c index 8375af9988c..8221cd43138 100644 --- a/gcc/testsuite/gcc.dg/attr-ifunc-2.c +++ b/gcc/testsuite/gcc.dg/attr-ifunc-2.c @@ -1,6 +1,8 @@ /* { dg-require-ifunc "" } */ -static void *resolver () +typedef int F (void); + +static F *resolver () { return 0; } diff --git a/gcc/testsuite/gcc.dg/attr-ifunc-3.c b/gcc/testsuite/gcc.dg/attr-ifunc-3.c index fbd972d7caa..653af856d6b 100644 --- a/gcc/testsuite/gcc.dg/attr-ifunc-3.c +++ b/gcc/testsuite/gcc.dg/attr-ifunc-3.c @@ -14,7 +14,7 @@ static int __attribute__((noinline)) return 0; } -static void *resolver (void) +static __typeof__ (implementation) *resolver (void) { return (void *)implementation; } diff --git a/gcc/testsuite/gcc.dg/attr-ifunc-4.c b/gcc/testsuite/gcc.dg/attr-ifunc-4.c index 698c06b1a74..5c87445b394 100644 --- a/gcc/testsuite/gcc.dg/attr-ifunc-4.c +++ b/gcc/testsuite/gcc.dg/attr-ifunc-4.c @@ -4,15 +4,15 @@ #include -static void *implementation (void) +static int implementation (void) { printf ("'ere I am JH\n"); return 0; } -static void *resolver (void) +static __typeof__ (implementation)* resolver (void) { - return (void *)implementation; + return implementation; } static int magic (void) __attribute__ ((ifunc ("resolver"))); diff --git a/gcc/testsuite/gcc.dg/attr-ifunc-5.c b/gcc/testsuite/gcc.dg/attr-ifunc-5.c index 4dddec430ef..1ecc391f739 100644 --- a/gcc/testsuite/gcc.dg/attr-ifunc-5.c +++ b/gcc/testsuite/gcc.dg/attr-ifunc-5.c @@ -4,13 +4,13 @@ #include -static void *implementation (void) +static int implementation (void) { printf ("'ere I am JH\n"); return 0; } -static void *resolver (void) +static __typeof__ (implementation)* resolver (void) { return (void *)implementation; } diff --git a/gcc/testsuite/gcc.dg/pr81854.c b/gcc/testsuite/gcc.dg/pr81854.c index 4b0f4da0f81..b8499f8b130 100644 --- a/gcc/testsuite/gcc.dg/pr81854.c +++ b/gcc/testsuite/gcc.dg/pr81854.c @@ -1,5 +1,6 @@ /* PR c/81854 - weak alias of an incompatible symbol accepted - { dg-do compile } */ + { dg-do compile } + { dg-require-ifunc "" } */ const char* __attribute__ ((weak, alias ("f0_target"))) f0 (void); /* { dg-error "alias between function and variable" } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 43d3c2c196d..f04687f382c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -439,7 +439,8 @@ proc check_ifunc_available { } { #ifdef __cplusplus extern "C" #endif - void g() {} + typedef void F (void); + F* g() {} void f() __attribute__((ifunc("g"))); }] }