Commit 7e9b8219 by Marek Polacek Committed by Marek Polacek

pr24626-2.c: Add function declarations.

	* gcc.dg/torture/pr24626-2.c: Add function declarations.  Fix
	defaulting to int.
	* gcc.dg/torture/pr28814.c: Likewise.
	* gcc.dg/torture/pr57036-1.c: Likewise.
	* gcc.dg/torture/inline-1.c: Add function declarations.
	* gcc.dg/torture/pr24626-1.c: Likewise.
	* gcc.dg/torture/pr24626-3.c: Likewise.
	* gcc.dg/torture/pr25947-1.c: Likewise.
	* gcc.dg/torture/pr27409.c: Likewise.
	* gcc.dg/torture/pr38948.c: Likewise.
	* gcc.dg/torture/pr44807.c: Likewise.
	* gcc.dg/torture/pr49603.c: Likewise.
	* gcc.dg/torture/pr45865.c: Likewise.
	* gcc.dg/torture/pr51071-2.c: Likewise.
	* gcc.dg/torture/pr51801.c: Likewise.
	* gcc.dg/torture/pr52720.c: Likewise.
	* gcc.dg/torture/pr55124.c: Likewise.
	* gcc.dg/torture/pr55238.c: Likewise.
	* gcc.dg/torture/pr55687.c: Likewise.
	* gcc.dg/torture/pr55888.c: Likewise.
	* gcc.dg/torture/pr57036-2.c: Likewise.
	* gcc.dg/torture/pr57147-3.c: Likewise.
	* gcc.dg/torture/pr57584.c: Likewise.
	* gcc.dg/torture/pr59993.c: Likewise.
	* gcc.dg/torture/pr58079.c: Likewise.
	* gcc.dg/torture/va-arg-25.c: Likewise.
	* gcc.dg/torture/vector-2.c: Likewise.
	* gcc.dg/torture/stackalign/nested-3.c: Likewise.
	* gcc.dg/torture/pr31254.c: Fix defaulting to int.
	* gcc.dg/torture/pr43781.c: Likewise.
	* gcc.dg/torture/pr52912.c: Likewise.
	* gcc.dg/torture/pr59139.c: Likewise.
	* gcc.dg/torture/pr55890-1.c: Likewise.
	* gcc.dg/torture/pr55890-2.c: Likewise.
	* gcc.dg/torture/pr59164.c: Likewise.
	* gcc.dg/torture/pr57393-2.c: Likewise.
	* gcc.dg/torture/stackalign/comp-goto-1.c: Likewise.
	* gcc.dg/torture/stackalign/non-local-goto-4.c: Likewise.
	* gcc.dg/torture/stackalign/non-local-goto-5.c: Likewise.
	* lib/target-supports.exp (check_effective_target_trapping): Likewise.
	* gcc.dg/torture/pr35227.c: Use -std=gnu89.  Fix defaulting to int.
	* gcc.dg/torture/stackalign/builtin-apply-4.c: Use -fgnu89-inline.

From-SVN: r215844
parent bcfee578
2014-10-03 Marek Polacek <polacek@redhat.com>
* gcc.dg/torture/pr24626-2.c: Add function declarations. Fix
defaulting to int.
* gcc.dg/torture/pr28814.c: Likewise.
* gcc.dg/torture/pr57036-1.c: Likewise.
* gcc.dg/torture/inline-1.c: Add function declarations.
* gcc.dg/torture/pr24626-1.c: Likewise.
* gcc.dg/torture/pr24626-3.c: Likewise.
* gcc.dg/torture/pr25947-1.c: Likewise.
* gcc.dg/torture/pr27409.c: Likewise.
* gcc.dg/torture/pr38948.c: Likewise.
* gcc.dg/torture/pr44807.c: Likewise.
* gcc.dg/torture/pr49603.c: Likewise.
* gcc.dg/torture/pr45865.c: Likewise.
* gcc.dg/torture/pr51071-2.c: Likewise.
* gcc.dg/torture/pr51801.c: Likewise.
* gcc.dg/torture/pr52720.c: Likewise.
* gcc.dg/torture/pr55124.c: Likewise.
* gcc.dg/torture/pr55238.c: Likewise.
* gcc.dg/torture/pr55687.c: Likewise.
* gcc.dg/torture/pr55888.c: Likewise.
* gcc.dg/torture/pr57036-2.c: Likewise.
* gcc.dg/torture/pr57147-3.c: Likewise.
* gcc.dg/torture/pr57584.c: Likewise.
* gcc.dg/torture/pr59993.c: Likewise.
* gcc.dg/torture/pr58079.c: Likewise.
* gcc.dg/torture/va-arg-25.c: Likewise.
* gcc.dg/torture/vector-2.c: Likewise.
* gcc.dg/torture/stackalign/nested-3.c: Likewise.
* gcc.dg/torture/pr31254.c: Fix defaulting to int.
* gcc.dg/torture/pr43781.c: Likewise.
* gcc.dg/torture/pr52912.c: Likewise.
* gcc.dg/torture/pr59139.c: Likewise.
* gcc.dg/torture/pr55890-1.c: Likewise.
* gcc.dg/torture/pr55890-2.c: Likewise.
* gcc.dg/torture/pr59164.c: Likewise.
* gcc.dg/torture/pr57393-2.c: Likewise.
* gcc.dg/torture/stackalign/comp-goto-1.c: Likewise.
* gcc.dg/torture/stackalign/non-local-goto-4.c: Likewise.
* gcc.dg/torture/stackalign/non-local-goto-5.c: Likewise.
* lib/target-supports.exp (check_effective_target_trapping): Likewise.
* gcc.dg/torture/pr35227.c: Use -std=gnu89. Fix defaulting to int.
* gcc.dg/torture/stackalign/builtin-apply-4.c: Use -fgnu89-inline.
2014-10-03 Jakub Jelinek <jakub@redhat.com> 2014-10-03 Jakub Jelinek <jakub@redhat.com>
PR libgomp/61200 PR libgomp/61200
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
and the eh info. */ and the eh info. */
/* PR tree-opt/30385 */ /* PR tree-opt/30385 */
int f (void);
static inline void g(int t) static inline void g(int t)
{ {
int a; int a;
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
typedef long typedef long
(*bla)(int *node); (*bla)(int *node);
void T(int *);
long F3(void *);
static long F2(void *tree, long blk, bla after_node_func) static long F2(void *tree, long blk, bla after_node_func)
{ {
......
...@@ -22,7 +22,12 @@ typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action; ...@@ -22,7 +22,12 @@ typedef enum { MU_REMOVE, MU_RENAME, MU_OPEN } mu_action;
typedef struct __dbpginfo { typedef struct __dbpginfo {
u_int8_t type; u_int8_t type;
} PAGE; } PAGE;
int __db_cursor ();
int __memp_fget ();
int __db_free ();
int __db_c_close ();
int __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags) int __db_master_update(mdbp, sdbp, txn, subdb, type, action, newname, flags)
int txn, subdb, type, action, newname, flags;
DB *mdbp, *sdbp; DB *mdbp, *sdbp;
{ {
DB_ENV *dbenv; DB_ENV *dbenv;
......
/* { dg-do compile } */ /* { dg-do compile } */
long fff(int*); long fff(int*);
void T(int*);
long F2(int *node) long F2(int *node)
{ {
......
...@@ -6,6 +6,7 @@ extern char *rl_line_buffer; ...@@ -6,6 +6,7 @@ extern char *rl_line_buffer;
extern int rl_point; extern int rl_point;
extern int rl_end; extern int rl_end;
static const char *vi_motion = " hl^$0ftFT;,%wbeWBE|"; static const char *vi_motion = " hl^$0ftFT;,%wbeWBE|";
void rl_vi_end_word (int, int);
void void
rl_vi_complete (int ignore, int key) rl_vi_complete (int ignore, int key)
{ {
......
...@@ -10,6 +10,7 @@ struct { ...@@ -10,6 +10,7 @@ struct {
int g; int g;
} my_struct; } my_struct;
void foo (thang_t *);
void function(int blaz) void function(int blaz)
{ {
thang_t *fp = &my_struct.f; thang_t *fp = &my_struct.f;
......
...@@ -7,6 +7,8 @@ struct w49 ...@@ -7,6 +7,8 @@ struct w49
} }
value; value;
}; };
void backtrace (const char *, int, int);
void
f9887 (struct w49 a23040) f9887 (struct w49 a23040)
{ {
unsigned long r9887; unsigned long r9887;
......
...@@ -19,6 +19,7 @@ static inline ...@@ -19,6 +19,7 @@ static inline
{ {
return &vnode->vfs_inode; return &vnode->vfs_inode;
}; };
void
afs_inode_map_status (struct afs_vnode *vnode) afs_inode_map_status (struct afs_vnode *vnode)
{ {
struct inode *inode = AFS_VNODE_TO_I (vnode); struct inode *inode = AFS_VNODE_TO_I (vnode);
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-std=gnu89" } */
int
mandel(double _Complex C) mandel(double _Complex C)
{ {
int py; int py;
......
...@@ -24,6 +24,7 @@ typedef struct gs_matrix_fixed_s ...@@ -24,6 +24,7 @@ typedef struct gs_matrix_fixed_s
int x; int x;
} }
gs_matrix_fixed; gs_matrix_fixed;
int gx_path_add_curve_notes ();
static int static int
append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath) append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath)
{ {
...@@ -78,6 +79,7 @@ append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath) ...@@ -78,6 +79,7 @@ append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath)
} }
} }
} }
void gs_matrix_multiply (gs_matrix *, const gs_matrix *, gs_matrix *);
int int
append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath) append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath)
{ {
......
...@@ -25,7 +25,7 @@ struct S2 g_320[2] = { ...@@ -25,7 +25,7 @@ struct S2 g_320[2] = {
}; };
void void
int32func (uint64p_34) int32func (int uint64p_34)
{ {
for (g_22.f3 = 0; g_22.f3 <= 0; g_22.f3) for (g_22.f3 = 0; g_22.f3 <= 0; g_22.f3)
{ {
......
/* { dg-do compile } */ /* { dg-do compile } */
int sigemptyset (int *);
int sigaddset(int, int);
int sigprocmask ();
struct jobstats struct jobstats
{ {
int j_jobslots; int j_jobslots;
......
...@@ -25,6 +25,7 @@ struct rtx_def { ...@@ -25,6 +25,7 @@ struct rtx_def {
unsigned int mode : 8; unsigned int mode : 8;
}; };
extern enum rtx_code reverse_condition (enum rtx_code); extern enum rtx_code reverse_condition (enum rtx_code);
extern enum rtx_code reverse_condition_maybe_unordered (enum rtx_code);
enum rtx_code enum rtx_code
reversed_comparison_code_parts (enum rtx_code code, rtx insn, rtx arg0, reversed_comparison_code_parts (enum rtx_code code, rtx insn, rtx arg0,
rtx arg1) rtx arg1)
......
...@@ -6,6 +6,7 @@ struct gl_visual { ...@@ -6,6 +6,7 @@ struct gl_visual {
struct gl_context { struct gl_context {
struct gl_visual *Visual; struct gl_visual *Visual;
}; };
void foo (char *);
void quickdraw_rgb( struct gl_context * ctx, void quickdraw_rgb( struct gl_context * ctx,
int width, int height) int width, int height)
{ {
......
...@@ -7,6 +7,7 @@ extern struct module __this_module; ...@@ -7,6 +7,7 @@ extern struct module __this_module;
static inline void static inline void
trace_module_get (struct module *mod, uintptr_t ip) { } trace_module_get (struct module *mod, uintptr_t ip) { }
struct module; struct module;
int module_is_live (struct module *);
static inline __attribute__((no_instrument_function)) static inline __attribute__((no_instrument_function))
int try_module_get(struct module *module) int try_module_get(struct module *module)
{ {
...@@ -29,6 +30,7 @@ struct net_device; ...@@ -29,6 +30,7 @@ struct net_device;
struct net_device_ops { struct net_device_ops {
int (*ndo_open)(struct net_device *dev); int (*ndo_open)(struct net_device *dev);
}; };
int hdlc_open (struct net_device *);
int t3e3_open(struct net_device *dev) int t3e3_open(struct net_device *dev)
{ {
int ret = hdlc_open(dev); int ret = hdlc_open(dev);
......
...@@ -4,6 +4,8 @@ typedef struct { char Vshow; } TScreen; ...@@ -4,6 +4,8 @@ typedef struct { char Vshow; } TScreen;
typedef struct _Misc { char Tshow; } Misc; typedef struct _Misc { char Tshow; } Misc;
typedef struct _XtermWidgetRec { TScreen screen; Misc misc; } XtermWidgetRec, *XtermWidget; typedef struct _XtermWidgetRec { TScreen screen; Misc misc; } XtermWidgetRec, *XtermWidget;
extern XtermWidget term; extern XtermWidget term;
void Bell (XtermWidget, int, int);
void set_tek_visibility (int);
void void
handle_tekshow (void *gw, int allowswitch) handle_tekshow (void *gw, int allowswitch)
......
...@@ -5,6 +5,7 @@ struct alu_bank_swizzle { ...@@ -5,6 +5,7 @@ struct alu_bank_swizzle {
int hw_gpr[3][4]; int hw_gpr[3][4];
int hw_cfile_addr[4]; int hw_cfile_addr[4];
}; };
void check_vector (struct alu_bank_swizzle *);
static void init_bank_swizzle(struct alu_bank_swizzle *bs) static void init_bank_swizzle(struct alu_bank_swizzle *bs)
{ {
int i, cycle, component; int i, cycle, component;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
int a, b, c; int a, b, c;
static int static int
fn1 (p1) fn1 (int p1)
{ {
lbl_549: lbl_549:
if (p1) if (p1)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
int a, b; int a, b;
long c; long c;
void foo(int);
void f2(void) void f2(void)
{ {
......
...@@ -12,6 +12,8 @@ typedef struct ...@@ -12,6 +12,8 @@ typedef struct
gz_state; gz_state;
void gz_error (gz_state *state, int err, char *msg); void gz_error (gz_state *state, int err, char *msg);
void foo (char *);
void bar (char *, char *);
static void static void
gz_reset (gz_state *state) gz_reset (gz_state *state)
......
...@@ -5,6 +5,7 @@ typedef short gshort; ...@@ -5,6 +5,7 @@ typedef short gshort;
typedef struct _GString GString; typedef struct _GString GString;
extern char *fgets(char *, int, FILE *); extern char *fgets(char *, int, FILE *);
extern void g_string_append_c_inline (GString *, char);
void verbose_text_loop (void *data) void verbose_text_loop (void *data)
{ {
......
...@@ -55,6 +55,8 @@ typedef enum ...@@ -55,6 +55,8 @@ typedef enum
PROTOBUF_C_WIRE_TYPE_END_GROUP, PROTOBUF_C_WIRE_TYPE_32BIT PROTOBUF_C_WIRE_TYPE_END_GROUP, PROTOBUF_C_WIRE_TYPE_32BIT
} }
ProtobufCWireType; ProtobufCWireType;
size_t tag_pack (uint32_t, uint8_t *);
size_t prefixed_message_pack (ProtobufCMessage *, uint8_t *);
static inline size_t static inline size_t
uint32_pack (uint32_t value, uint8_t * out) uint32_pack (uint32_t value, uint8_t * out)
{ {
......
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
extern void *memmove(void *, void *, __SIZE_TYPE__); extern void *memmove(void *, void *, __SIZE_TYPE__);
typedef int (*_TEST_fun_) (); typedef int (*_TEST_fun_) ();
static _TEST_fun_ i = (_TEST_fun_) memmove; static _TEST_fun_ i = (_TEST_fun_) memmove;
main() { i(); } int main() { i(); }
/* { dg-do compile } */ /* { dg-do compile } */
extern void *memcpy(); extern void *memcpy();
main() { memcpy(); } int main() { memcpy(); }
/* { dg-do compile } */ /* { dg-do compile } */
extern void g (void); extern void g (void);
int _setjmp();
int read_buf_open (void);
extern __inline __attribute__ ((__always_inline__,__leaf__)) extern __inline __attribute__ ((__always_inline__,__leaf__))
void
f () f ()
{ {
g (); g ();
......
/* { dg-do compile } */ /* { dg-do compile } */
int j_; int j_;
void g (void);
int jpgDecode_convert (unsigned i) int jpgDecode_convert (unsigned i)
{ {
__label__ label; __label__ label;
......
...@@ -5,6 +5,8 @@ struct __jmp_buf_tag { ...@@ -5,6 +5,8 @@ struct __jmp_buf_tag {
}; };
typedef struct __jmp_buf_tag sigjmp_buf[1]; typedef struct __jmp_buf_tag sigjmp_buf[1];
sigjmp_buf GC_jmp_buf; sigjmp_buf GC_jmp_buf;
int __sigsetjmp (sigjmp_buf, int);
void GC_set_and_save_fault_handler (void (*)(int));
void GC_fault_handler(int sig) void GC_fault_handler(int sig)
{ {
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
char a; char a;
void
foo (int **p) foo (int **p)
{ {
int b; int b;
......
...@@ -32,6 +32,8 @@ struct scm_vm { ...@@ -32,6 +32,8 @@ struct scm_vm {
}; };
static SCM vm_regular_engine (SCM vm, SCM program, SCM *argv, int nargs) { static SCM vm_regular_engine (SCM vm, SCM program, SCM *argv, int nargs) {
} }
void vm_dispatch_hook ();
int _setjmp ();
static SCM vm_debug_engine (SCM vm, SCM program, SCM *argv, int nargs) { static SCM vm_debug_engine (SCM vm, SCM program, SCM *argv, int nargs) {
register scm_t_uint8 *ip ; register scm_t_uint8 *ip ;
register SCM *sp ; register SCM *sp ;
......
...@@ -43,6 +43,7 @@ struct dvb_demux { ...@@ -43,6 +43,7 @@ struct dvb_demux {
struct list_head feed_list; struct list_head feed_list;
}; };
int dvb_dmx_swfilter_section_packet (struct dvb_demux_feed *, const u8 *);
static static
inline inline
......
/* { dg-do compile } */ /* { dg-do compile } */
int a, b, c, d, e; int a, b, c, d, e;
int fn1(p1, p2) { return p2 == 0 ? p1 : 1 % p2; } int fn1(int p1, int p2) { return p2 == 0 ? p1 : 1 % p2; }
void fn2() void fn2()
{ {
......
...@@ -4,7 +4,7 @@ int a, d, e; ...@@ -4,7 +4,7 @@ int a, d, e;
long b[10]; long b[10];
int c[10][8]; int c[10][8];
int fn1(p1) int fn1(int p1)
{ {
return 1 >> p1; return 1 >> p1;
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
extern int optind; extern int optind;
jmp_buf jump_buf; jmp_buf jump_buf;
void foo (jmp_buf, int);
void bar (char *);
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
......
/* PR tree-optimization/20076 */ /* PR tree-optimization/20076 */
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-fgnu89-inline" } */
extern void abort (void); extern void abort (void);
......
...@@ -11,10 +11,10 @@ extern void exit (int); ...@@ -11,10 +11,10 @@ extern void exit (int);
#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
int int
x(a) x(int a)
{ {
__label__ xlab; __label__ xlab;
void y(a) void y(int a)
{ {
void *x = &&llab; void *x = &&llab;
if (a==-1) if (a==-1)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#endif #endif
typedef int aligned __attribute__((aligned(ALIGNMENT))); typedef int aligned __attribute__((aligned(ALIGNMENT)));
extern int strncmp (const char *, const char *, size_t);
int global; int global;
......
...@@ -11,11 +11,10 @@ extern void exit (int); ...@@ -11,11 +11,10 @@ extern void exit (int);
#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
int int
x(int a)
x(a)
{ {
__label__ xlab; __label__ xlab;
void y(a) void y(int a)
{ {
if (a==0) if (a==0)
goto xlab; goto xlab;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
extern void exit (int); extern void exit (int);
#if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES) #if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
extern void abort (void); extern void abort (void);
int s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;} int s(int i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;}
int x(){return s(0)==1&&s(1)==0&&s(2)==1;} int x(){return s(0)==1&&s(1)==0&&s(2)==1;}
int main(){if(x()!=1)abort();exit(0);} int main(){if(x()!=1)abort();exit(0);}
#else #else
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
const vector unsigned int v1 = {10,11,12,13}; const vector unsigned int v1 = {10,11,12,13};
const vector unsigned int v2 = {20,21,22,23}; const vector unsigned int v2 = {20,21,22,23};
extern int memcmp (const void *, const void *, size_t);
void foo(int a, ...) void foo(int a, ...)
{ {
va_list args; va_list args;
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#define vector __attribute__((vector_size(16) )) #define vector __attribute__((vector_size(16) ))
extern int memcmp (const void *, const void *, __SIZE_TYPE__);
vector int f0(vector int t, int a) vector int f0(vector int t, int a)
{ {
((int*)&t)[0] = a; ((int*)&t)[0] = a;
......
...@@ -702,7 +702,7 @@ proc check_effective_target_scheduling {} { ...@@ -702,7 +702,7 @@ proc check_effective_target_scheduling {} {
proc check_effective_target_trapping {} { proc check_effective_target_trapping {} {
return [check_no_compiler_messages trapping object { return [check_no_compiler_messages trapping object {
add (int a, int b) { return a + b; } int add (int a, int b) { return a + b; }
} "-ftrapv"] } "-ftrapv"]
} }
......
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