This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Testsuite tweeks
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 15 Nov 2008 21:27:53 +0100
- Subject: Testsuite tweeks
Hi,
while making inliner changes and pure/const changes I noticed several
tests that are quite fragile WRT IPA so they no longer test what they
are supposed to afterwards.
Since this only makes tests more robust, perhaps it can be merged now?
Bootstrapped/regtested i686-linux.
* gcc.dg/attr-noinline.c: Avoid pure-const optimization.
* gcc.dg/ipa/ipa-3.c: Avoid pure-const optimization.
* gcc.dg/ipa/ipa-5.c: Avoid pure-const optimization.
* gcc.dg/ipa/ipa-4.c: Add -fno-early-inlining.
* gcc.dg/sibcall-1.c: Add noinline.
* gcc.target/i386/align-main-2.c: Add noinline.
* gcc.target/i386/align-main-1.c: Add noinline.
* gcc.c-torture/compile/pr22379.c: Add noinline.
Index: testsuite/gcc.dg/attr-noinline.c
===================================================================
*** testsuite/gcc.dg/attr-noinline.c (revision 141798)
--- testsuite/gcc.dg/attr-noinline.c (working copy)
***************
*** 1,39 ****
/* { dg-do compile } */
/* { dg-options "-O2 -finline-functions" } */
! static inline void __attribute__((__noinline__)) function_definition(void) {} /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
static inline void __attribute__((__noinline__)) function_declaration_both_before(void); /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
! static void function_declaration_both_before(void) {}
static void function_declaration_both_after(void);
static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute noinline|declared inline after its definition)" "" } */
! static void function_declaration_both_after(void) {}
static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
! static inline void function_declaration_noinline_before(void) {} /* { dg-warning "follows declaration with attribute noinline" "" } */
! static inline void function_declaration_noinline_after(void) {} /* { dg-message "note: previous definition" "" } */
static void function_declaration_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
static inline void function_declaration_inline_before(void); /* { dg-message "note: previous declaration" "" } */
! static void __attribute__((__noinline__)) function_declaration_inline_before(void) {} /* { dg-warning "follows inline declaration" "" } */
static inline void function_declaration_inline_noinline_before(void); /* { dg-message "note: previous declaration" "" } */
static void function_declaration_inline_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
! static void function_declaration_inline_noinline_before(void) {}
static inline void function_declaration_inline_noinline_after(void);
! static void function_declaration_inline_noinline_after(void) {} /* { dg-message "note: previous definition" "" } */
static void function_declaration_inline_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
--- 1,41 ----
/* { dg-do compile } */
/* { dg-options "-O2 -finline-functions" } */
! extern int t();
!
! static inline void __attribute__((__noinline__)) function_definition(void) {t();} /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
static inline void __attribute__((__noinline__)) function_declaration_both_before(void); /* { dg-warning "inline function \[^\n\]* given attribute noinline" "" } */
! static void function_declaration_both_before(void) {t();}
static void function_declaration_both_after(void);
static inline void __attribute__((__noinline__)) function_declaration_both_after(void); /* { dg-warning "(inline function \[^\n\]* given attribute noinline|declared inline after its definition)" "" } */
! static void function_declaration_both_after(void) {t();}
static void function_declaration_noinline_before(void) __attribute__((__noinline__)); /* { dg-message "note: previous declaration" "" } */
! static inline void function_declaration_noinline_before(void) {t();} /* { dg-warning "follows declaration with attribute noinline" "" } */
! static inline void function_declaration_noinline_after(void) {t();} /* { dg-message "note: previous definition" "" } */
static void function_declaration_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
static inline void function_declaration_inline_before(void); /* { dg-message "note: previous declaration" "" } */
! static void __attribute__((__noinline__)) function_declaration_inline_before(void) {t();} /* { dg-warning "follows inline declaration" "" } */
static inline void function_declaration_inline_noinline_before(void); /* { dg-message "note: previous declaration" "" } */
static void function_declaration_inline_noinline_before(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
! static void function_declaration_inline_noinline_before(void) {t();}
static inline void function_declaration_inline_noinline_after(void);
! static void function_declaration_inline_noinline_after(void) {t();} /* { dg-message "note: previous definition" "" } */
static void function_declaration_inline_noinline_after(void) __attribute__((__noinline__)); /* { dg-warning "follows inline declaration" "" } */
*************** static void function_declaration_noinlin
*** 41,47 ****
static inline void function_declaration_noinline_inline_before(void); /* { dg-warning "follows declaration with attribute noinline" "" } */
! static void function_declaration_noinline_inline_before(void) {}
void f () {
function_definition ();
--- 43,49 ----
static inline void function_declaration_noinline_inline_before(void); /* { dg-warning "follows declaration with attribute noinline" "" } */
! static void function_declaration_noinline_inline_before(void) {t();}
void f () {
function_definition ();
Index: testsuite/gcc.dg/ipa/ipa-3.c
===================================================================
*** testsuite/gcc.dg/ipa/ipa-3.c (revision 141798)
--- testsuite/gcc.dg/ipa/ipa-3.c (working copy)
***************
*** 6,13 ****
--- 6,15 ----
/* Double constants. */
#include <stdio.h>
+ void t(void);
int g (double b, double c)
{
+ t();
return (int)(b+c);
}
int f (double a)
Index: testsuite/gcc.dg/ipa/ipa-5.c
===================================================================
*** testsuite/gcc.dg/ipa/ipa-5.c (revision 141798)
--- testsuite/gcc.dg/ipa/ipa-5.c (working copy)
***************
*** 5,16 ****
--- 5,19 ----
/* Float & short constants. */
#include <stdio.h>
+ void t(void);
int g (float b, short c)
{
+ t();
return c + (int)b;
}
int f (float a)
{
+ t();
/* a is modified. */
if (a++ > 0)
g (a, 3);
Index: testsuite/gcc.c-torture/compile/pr22379.c
===================================================================
*** testsuite/gcc.c-torture/compile/pr22379.c (revision 141874)
--- testsuite/gcc.c-torture/compile/pr22379.c (working copy)
*************** static inline __attribute__((always_inli
*** 8,13 ****
--- 8,14 ----
extract_entropy();
add_entropy_words();
}
+ __attribute__ ((noinline))
void extract_entropy(void)
{
xfer_secondary_pool();
Index: testsuite/gcc.target/i386/align-main-1.c
===================================================================
*** testsuite/gcc.target/i386/align-main-1.c (revision 141874)
--- testsuite/gcc.target/i386/align-main-1.c (working copy)
***************
*** 11,16 ****
--- 11,17 ----
typedef int aligned __attribute__((aligned(ALIGNMENT)));
extern void abort(void);
+ __attribute__ ((noinline))
void check(void * a)
{
if (((ptrdiff_t)a & (ALIGNMENT-1)) != 0)
Index: testsuite/gcc.target/i386/align-main-2.c
===================================================================
*** testsuite/gcc.target/i386/align-main-2.c (revision 141874)
--- testsuite/gcc.target/i386/align-main-2.c (working copy)
***************
*** 11,16 ****
--- 11,17 ----
typedef int aligned __attribute__((aligned(ALIGNMENT)));
extern void abort(void);
+ __attribute__ ((noinline))
void check(void * a)
{
if (((ptrdiff_t)a & (ALIGNMENT-1)) != 0)
Index: testsuite/gcc.dg/sibcall-1.c
===================================================================
*** testsuite/gcc.dg/sibcall-1.c (revision 141874)
--- testsuite/gcc.dg/sibcall-1.c (working copy)
*************** recurser_void (int n)
*** 37,42 ****
--- 37,43 ----
void *trackpoint;
+ __attribute__ ((noinline))
void
track (int n)
{
Index: testsuite/gcc.dg/ipa/ipa-4.c
===================================================================
*** testsuite/gcc.dg/ipa/ipa-4.c (revision 141874)
--- testsuite/gcc.dg/ipa/ipa-4.c (working copy)
***************
*** 1,5 ****
/* { dg-do compile } */
! /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
#include <stdio.h>
--- 1,5 ----
/* { dg-do compile } */
! /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
#include <stdio.h>