Commit 9dddb6f5 by Marek Polacek Committed by Marek Polacek

20000120-2.c: Use -fgnu89-inline.

	* gcc.c-torture/compile/20000120-2.c: Use -fgnu89-inline.
	* gcc.c-torture/compile/20011119-1.c: Likewise.
	* gcc.c-torture/compile/20011119-2.c: Likewise.
	* gcc.c-torture/compile/20021120-1.c: Likewise.
	* gcc.c-torture/compile/20021120-2.c: Likewise.
	* gcc.c-torture/compile/20050215-1.c: Likewise.
	* gcc.c-torture/compile/20050215-2.c: Likewise.
	* gcc.c-torture/compile/20050215-3.c: Likewise.
	* gcc.c-torture/compile/pr37669.c: Likewise.
	* gcc.c-torture/execute/20020107-1.c: Likewise.
	* gcc.c-torture/execute/restrict-1.c: Likewise.
	* gcc.c-torture/compile/20090721-1.c: Fix defaulting to int.
	* gcc.c-torture/execute/930529-1.c: Likewise.
	* gcc.c-torture/execute/920612-1.c: Likewise.
	* gcc.c-torture/execute/920711-1.c: Likewise.
	* gcc.c-torture/execute/990127-2.c: Likewise.
	* gcc.c-torture/execute/pr40386.c: Likewise.
	* gcc.c-torture/execute/pr57124.c: Likewise.
	* gcc.c-torture/compile/pr34808.c: Add function declarations.
	* gcc.c-torture/compile/pr42299.c: Likewise.
	* gcc.c-torture/compile/pr48517.c: Use -std=gnu89.
	* gcc.c-torture/compile/simd-6.c: Likewise.
	* gcc.c-torture/execute/pr53645-2.c: Likewise.
	* gcc.c-torture/execute/pr53645.c: Likewise.
	* gcc.c-torture/execute/20001121-1.c: Use -fgnu89-inline.  Add function
	declarations.
	* gcc.c-torture/execute/980608-1.c: Likewise.
	* gcc.c-torture/execute/bcp-1.c: Likewise.
	* gcc.c-torture/execute/p18298.c: Likewise.
	* gcc.c-torture/execute/unroll-1.c: Likewise.
	* gcc.c-torture/execute/va-arg-7.c: Likewise.
	* gcc.c-torture/execute/va-arg-8.c: Likewise.
	* gcc.c-torture/execute/930526-1.c: Use -fgnu89-inline.  Add function
	declarations.  Fix defaulting to int.
	* gcc.c-torture/execute/961223-1.c: Likewise.
	* gcc.c-torture/execute/loop-2c.c: Use -fgnu89-inline and
	-Wno-pointer-to-int-cast.  Fix defaulting to int.

From-SVN: r215798
parent 8a605c51
2014-10-02 Marek Polacek <polacek@redhat.com>
* gcc.c-torture/compile/20000120-2.c: Use -fgnu89-inline.
* gcc.c-torture/compile/20011119-1.c: Likewise.
* gcc.c-torture/compile/20011119-2.c: Likewise.
* gcc.c-torture/compile/20021120-1.c: Likewise.
* gcc.c-torture/compile/20021120-2.c: Likewise.
* gcc.c-torture/compile/20050215-1.c: Likewise.
* gcc.c-torture/compile/20050215-2.c: Likewise.
* gcc.c-torture/compile/20050215-3.c: Likewise.
* gcc.c-torture/compile/pr37669.c: Likewise.
* gcc.c-torture/execute/20020107-1.c: Likewise.
* gcc.c-torture/execute/restrict-1.c: Likewise.
* gcc.c-torture/compile/20090721-1.c: Fix defaulting to int.
* gcc.c-torture/execute/930529-1.c: Likewise.
* gcc.c-torture/execute/920612-1.c: Likewise.
* gcc.c-torture/execute/920711-1.c: Likewise.
* gcc.c-torture/execute/990127-2.c: Likewise.
* gcc.c-torture/execute/pr40386.c: Likewise.
* gcc.c-torture/execute/pr57124.c: Likewise.
* gcc.c-torture/compile/pr34808.c: Add function declarations.
* gcc.c-torture/compile/pr42299.c: Likewise.
* gcc.c-torture/compile/pr48517.c: Use -std=gnu89.
* gcc.c-torture/compile/simd-6.c: Likewise.
* gcc.c-torture/execute/pr53645-2.c: Likewise.
* gcc.c-torture/execute/pr53645.c: Likewise.
* gcc.c-torture/execute/20001121-1.c: Use -fgnu89-inline. Add function
declarations.
* gcc.c-torture/execute/980608-1.c: Likewise.
* gcc.c-torture/execute/bcp-1.c: Likewise.
* gcc.c-torture/execute/p18298.c: Likewise.
* gcc.c-torture/execute/unroll-1.c: Likewise.
* gcc.c-torture/execute/va-arg-7.c: Likewise.
* gcc.c-torture/execute/va-arg-8.c: Likewise.
* gcc.c-torture/execute/930526-1.c: Use -fgnu89-inline. Add function
declarations. Fix defaulting to int.
* gcc.c-torture/execute/961223-1.c: Likewise.
* gcc.c-torture/execute/loop-2c.c: Use -fgnu89-inline and
-Wno-pointer-to-int-cast. Fix defaulting to int.
2014-10-02 Andrew Pinski <apinski@cavium.com> 2014-10-02 Andrew Pinski <apinski@cavium.com>
Max Ostapenko <m.ostapenko@partner.samsung.com> Max Ostapenko <m.ostapenko@partner.samsung.com>
......
/* { dg-options "-fgnu89-inline" } */
extern __inline__ int extern __inline__ int
odd(int i) odd(int i)
{ {
......
/* { dg-options "-fgnu89-inline" } */
/* { dg-require-weak "" } */ /* { dg-require-weak "" } */
/* { dg-require-alias "" } */ /* { dg-require-alias "" } */
#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
......
/* { dg-options "-fgnu89-inline" } */
/* { dg-require-weak "" } */ /* { dg-require-weak "" } */
/* { dg-require-alias "" } */ /* { dg-require-alias "" } */
#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
/* Verify that GCC doesn't get confused by the /* Verify that GCC doesn't get confused by the
redefinition of an extern inline function. */ redefinition of an extern inline function. */
/* { dg-options "-fgnu89-inline" } */
extern int inline foo () { return 0; } extern int inline foo () { return 0; }
extern int inline bar () { return 0; } extern int inline bar () { return 0; }
static int inline bar () { return foo(); } static int inline bar () { return foo(); }
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
/* Verify that GCC doesn't get confused by the /* Verify that GCC doesn't get confused by the
redefinition of an extern inline function. */ redefinition of an extern inline function. */
/* { dg-options "-fgnu89-inline" } */
extern int inline foo () { return 0; } extern int inline foo () { return 0; }
extern int inline bar () { return 0; } extern int inline bar () { return 0; }
static int bar () { return foo(); } static int bar () { return foo(); }
/* PR tree-optimization/18947 */ /* PR tree-optimization/18947 */
/* { dg-options "-fgnu89-inline" } */
extern __inline void f1 (void) { } extern __inline void f1 (void) { }
extern __inline void f2 (void) { f1 (); } extern __inline void f2 (void) { f1 (); }
void f2 (void) {} void f2 (void) {}
/* PR tree-optimization/18947 */ /* PR tree-optimization/18947 */
/* { dg-options "-fgnu89-inline" } */
int v; int v;
extern __inline void f1 (void) { v++; } extern __inline void f1 (void) { v++; }
void f4 (void) { f1 (); } void f4 (void) { f1 (); }
......
/* PR tree-optimization/18947 */ /* PR tree-optimization/18947 */
/* { dg-options "-fgnu89-inline" } */
int v; int v;
extern __inline void f0 (void) { v++; } extern __inline void f0 (void) { v++; }
extern __inline void f1 (void) { f0 (); } extern __inline void f1 (void) { f0 (); }
......
/* { dg-options "-fno-tree-sra" } */ /* { dg-options "-fno-tree-sra" } */
union u {double d;long long ll;}; union u {double d;long long ll;};
f(double x, int n){union u v;v.d=x;if(n>=0){v.ll<<=63;}else{v.ll-=1<<-n;v.ll>>=-n;}return v.ll;} int f(double x, int n){union u v;v.d=x;if(n>=0){v.ll<<=63;}else{v.ll-=1<<-n;v.ll>>=-n;}return v.ll;}
...@@ -6,6 +6,9 @@ extern int flags; ...@@ -6,6 +6,9 @@ extern int flags;
struct r { int code; int val;}; struct r { int code; int val;};
void bar (void);
void baz (void);
int int
foo (struct r *home) foo (struct r *home)
{ {
......
/* This testcase used to fail because a miscompiled execute_fold_all_builtins. */ /* This testcase used to fail because a miscompiled execute_fold_all_builtins. */
/* { dg-options "-fgnu89-inline" } */
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
extern __inline __attribute__ ((__always_inline__)) int __attribute__ extern __inline __attribute__ ((__always_inline__)) int __attribute__
......
/* { dg-options "-g" } */ /* { dg-options "-g" } */
void bar (void);
static int static int
foo (int x, int y) foo (int x, int y)
{ {
......
/* PR c/48517 */ /* PR c/48517 */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "" } */ /* { dg-options "-std=gnu89" } */
void bar (const unsigned short *); void bar (const unsigned short *);
......
/* { dg-options "-std=gnu89" } */
typedef int __attribute__((vector_size (8))) vec; typedef int __attribute__((vector_size (8))) vec;
vec a[] = {(vec) {1, 2}, {3, 4}}; vec a[] = {(vec) {1, 2}, {3, 4}};
/* { dg-options "-fgnu89-inline" } */
extern void abort (void);
extern void exit (int);
double d; double d;
__inline__ double foo (void) __inline__ double foo (void)
......
/* This testcase failed because - 1 - buf was simplified into ~buf and when /* This testcase failed because - 1 - buf was simplified into ~buf and when
later expanding it back into - buf + -1, -1 got lost. */ later expanding it back into - buf + -1, -1 got lost. */
/* { dg-options "-fgnu89-inline" } */
extern void abort (void); extern void abort (void);
extern void exit (int); extern void exit (int);
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
extern void abort (void); extern void abort (void);
extern void exit (int); extern void exit (int);
f(j)int j;{return++j>0;} int f(j)int j;{return++j>0;}
main(){if(f((~0U)>>1))abort();exit(0);} int main(){if(f((~0U)>>1))abort();exit(0);}
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
extern void abort (void); extern void abort (void);
extern void exit (int); extern void exit (int);
f(long a){return (--a > 0);} int f(long a){return (--a > 0);}
main(){if(f(0x80000000L)==0)abort();exit(0);} int main(){if(f(0x80000000L)==0)abort();exit(0);}
inline /* { dg-options "-fgnu89-inline" } */
f (x)
extern void exit (int);
inline void
f (int x)
{ {
int *(p[25]); int *(p[25]);
int m[25*7]; int m[25*7];
...@@ -11,6 +15,7 @@ f (x) ...@@ -11,6 +15,7 @@ f (x)
p[1][0] = 0; p[1][0] = 0;
} }
int
main () main ()
{ {
f (7); f (7);
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
extern void abort (void); extern void abort (void);
extern void exit (int); extern void exit (int);
dd (x,d) { return x / d; } int dd (int x, int d) { return x / d; }
int
main () main ()
{ {
int i; int i;
......
/* { dg-options "-fgnu89-inline" } */
extern void exit (int);
extern void abort (void);
struct s { struct s {
double d; double d;
}; };
...@@ -9,6 +14,7 @@ sub (struct s s) ...@@ -9,6 +14,7 @@ sub (struct s s)
return s; return s;
} }
int
main () main ()
{ {
struct s t = { 2.0 }; struct s t = { 2.0 };
......
/* { dg-options "-fgnu89-inline" } */
#include <stdarg.h> #include <stdarg.h>
extern void abort(void);
extern void exit (int);
void f1(int a,int b,int c,int d,int e, int f,int g,int h,int i,int j, int k,int void f1(int a,int b,int c,int d,int e, int f,int g,int h,int i,int j, int k,int
l,int m,int n,int o) l,int m,int n,int o)
{ {
......
...@@ -18,6 +18,7 @@ fpTest (double x, double y) ...@@ -18,6 +18,7 @@ fpTest (double x, double y)
fpEq (result1, result2); fpEq (result1, result2);
} }
int
main () main ()
{ {
fpTest (35.7, 45.0); fpTest (35.7, 45.0);
......
/* { dg-options "-fgnu89-inline" } */
extern void abort (void);
extern void exit (int);
__attribute__ ((externally_visible)) int global; __attribute__ ((externally_visible)) int global;
int func(void); int func(void);
......
/* { dg-options "-fgnu89-inline -Wno-pointer-to-int-cast" } */
extern void abort (void);
extern void exit (int);
int a[2]; int a[2];
__inline__ f (b, o) __inline__ void f (int b, int o)
{ {
unsigned int i; unsigned int i;
int *p; int *p;
...@@ -8,11 +13,13 @@ __inline__ f (b, o) ...@@ -8,11 +13,13 @@ __inline__ f (b, o)
*--p = i * 3 + o; *--p = i * 3 + o;
} }
void
g(int b) g(int b)
{ {
f (b, (int)a); f (b, (int)a);
} }
int
main () main ()
{ {
a[0] = a[1] = 0; a[0] = a[1] = 0;
......
/* { dg-options "-fgnu89-inline" } */
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
extern void abort (void);
int strcmp (const char*, const char*); int strcmp (const char*, const char*);
char s[2048] = "a"; char s[2048] = "a";
inline bool foo(const char *str) { inline bool foo(const char *str) {
......
...@@ -25,6 +25,7 @@ long long ll = LL_VALUE; ...@@ -25,6 +25,7 @@ long long ll = LL_VALUE;
int shift1 = SHIFT1; int shift1 = SHIFT1;
int shift2 = SHIFT2; int shift2 = SHIFT2;
int
main () main ()
{ {
if (ROR (c, shift1) != ROR (CHAR_VALUE, SHIFT1)) if (ROR (c, shift1) != ROR (CHAR_VALUE, SHIFT1))
......
/* PR tree-optimization/53645 */ /* PR tree-optimization/53645 */
/* { dg-options "-std=gnu89" } */
typedef unsigned short int UV __attribute__((vector_size (16))); typedef unsigned short int UV __attribute__((vector_size (16)));
typedef short int SV __attribute__((vector_size (16))); typedef short int SV __attribute__((vector_size (16)));
......
/* PR tree-optimization/53645 */ /* PR tree-optimization/53645 */
/* { dg-options "-std=gnu89" } */
typedef unsigned int UV __attribute__((vector_size (16))); typedef unsigned int UV __attribute__((vector_size (16)));
typedef int SV __attribute__((vector_size (16))); typedef int SV __attribute__((vector_size (16)));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
extern void abort (void); extern void abort (void);
extern void exit (int); extern void exit (int);
__attribute__ ((noinline)) __attribute__ ((noinline)) void
foo(short unsigned int *p1, short unsigned int *p2) foo(short unsigned int *p1, short unsigned int *p2)
{ {
short unsigned int x1, x4; short unsigned int x1, x4;
...@@ -23,6 +23,7 @@ foo(short unsigned int *p1, short unsigned int *p2) ...@@ -23,6 +23,7 @@ foo(short unsigned int *p1, short unsigned int *p2)
exit (0); exit (0);
} }
int
main() main()
{ {
short unsigned int x, y; short unsigned int x, y;
...@@ -30,4 +31,3 @@ main() ...@@ -30,4 +31,3 @@ main()
y = -10; y = -10;
foo (&x, &y); foo (&x, &y);
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
Origin: Jeremy Denise <jeremy.denise@libertysurf.fr> Origin: Jeremy Denise <jeremy.denise@libertysurf.fr>
Reduced: Wolfgang Bangerth <bangerth@dealii.org> Reduced: Wolfgang Bangerth <bangerth@dealii.org>
Volker Reichelt <reichelt@igpm.rwth-aachen.de> */ Volker Reichelt <reichelt@igpm.rwth-aachen.de> */
/* { dg-options "-fgnu89-inline" } */
extern void abort (); extern void abort ();
......
/* { dg-options "-fgnu89-inline" } */
extern void abort (void);
extern void exit (int);
inline int inline int
f (int x) f (int x)
{ {
......
/* Origin: Franz Sirl <Franz.Sirl-kernel@lauterbach.com> */ /* Origin: Franz Sirl <Franz.Sirl-kernel@lauterbach.com> */
/* { dg-options "-fgnu89-inline" } */
extern void abort (void);
extern void exit (int);
#include <stdarg.h> #include <stdarg.h>
......
/* Origin: Franz Sirl <Franz.Sirl-kernel@lauterbach.com> */ /* Origin: Franz Sirl <Franz.Sirl-kernel@lauterbach.com> */
/* { dg-options "-fgnu89-inline" } */
extern void abort (void);
extern void exit (int);
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
......
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