aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2008-09-09 10:56:23 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2008-09-09 10:56:23 +0000
commit1751ecd619cd564d1e1b0c203c9ae65c75c7c216 (patch)
tree166fffc125acbefeaadfe937a4ae5c5e18d0c996 /gcc/testsuite
parenta135b1c41c63e75ad1b8d74345eca520e973e2f9 (diff)
downloadgcc-1751ecd619cd564d1e1b0c203c9ae65c75c7c216.zip
gcc-1751ecd619cd564d1e1b0c203c9ae65c75c7c216.tar.gz
gcc-1751ecd619cd564d1e1b0c203c9ae65c75c7c216.tar.bz2
function.h (struct function): Add function_start_locus.
* function.h (struct function): Add function_start_locus. * cfgexpand.c (gimple_expand_cfg): Use it. * c-parser.c (c_parser_declaration_or_fndef): Set it. testsuite/ * gcc.dg/always_inline.c: Place error message on function name line. * gcc.dg/winline-6.c: Same. * gcc.dg/noreturn-1.c: Same. * gcc.dg/noreturn-7.c: Same. * gcc.dg/inline-14.c: Same. * gcc.dg/always_inline3.c: Same. * gcc.dg/winline-3.c: Same. * gcc.dg/wtr-func-def-1.c: Same. * gcc.dg/winline-5.c: Same. * gcc.dg/winline-7.c: Same. * gcc.dg/winline-9.c: Same. * gcc.dg/noreturn-4.c: Same. * gcc.dg/20041213-1.c: Use column numbers. From-SVN: r140144
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog17
-rw-r--r--gcc/testsuite/gcc.dg/20041213-1.c38
-rw-r--r--gcc/testsuite/gcc.dg/always_inline.c4
-rw-r--r--gcc/testsuite/gcc.dg/always_inline3.c4
-rw-r--r--gcc/testsuite/gcc.dg/inline-14.c8
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-7.c12
-rw-r--r--gcc/testsuite/gcc.dg/winline-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-6.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-7.c4
-rw-r--r--gcc/testsuite/gcc.dg/winline-9.c4
-rw-r--r--gcc/testsuite/gcc.dg/wtr-func-def-1.c60
14 files changed, 94 insertions, 77 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1378257..2d18227 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+2008-09-09 Aldy Hernandez <aldyh@redhat.com>
+
+ * gcc.dg/always_inline.c: Place error message on function
+ name line.
+ * gcc.dg/winline-6.c: Same.
+ * gcc.dg/noreturn-1.c: Same.
+ * gcc.dg/noreturn-7.c: Same.
+ * gcc.dg/inline-14.c: Same.
+ * gcc.dg/always_inline3.c: Same.
+ * gcc.dg/winline-3.c: Same.
+ * gcc.dg/wtr-func-def-1.c: Same.
+ * gcc.dg/winline-5.c: Same.
+ * gcc.dg/winline-7.c: Same.
+ * gcc.dg/winline-9.c: Same.
+ * gcc.dg/noreturn-4.c: Same.
+ * gcc.dg/20041213-1.c: Use column numbers.
+
2008-09-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37433
diff --git a/gcc/testsuite/gcc.dg/20041213-1.c b/gcc/testsuite/gcc.dg/20041213-1.c
index be1ab00..aeff744 100644
--- a/gcc/testsuite/gcc.dg/20041213-1.c
+++ b/gcc/testsuite/gcc.dg/20041213-1.c
@@ -1,33 +1,33 @@
/* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-fshow-column" } */
/* test redeclarations with void and implicit int */
-extern foo1(); /* { dg-message "note: previous declaration" } */
-extern void foo1(); /* { dg-error "conflicting types" } */
+extern foo1(); /* { dg-message "8:note: previous declaration" } */
+extern void foo1(); /* { dg-error "13:conflicting types" } */
-extern void foo2(); /* { dg-message "note: previous declaration" } */
-extern foo2(); /* { dg-error "conflicting types" } */
+extern void foo2(); /* { dg-message "13:note: previous declaration" } */
+extern foo2(); /* { dg-error "8:conflicting types" } */
-void foo3() {} /* { dg-message "note: previous definition" } */
-extern foo3(); /* { dg-error "conflicting types" } */
+void foo3() {} /* { dg-message "6:note: previous definition" } */
+extern foo3(); /* { dg-error "8:conflicting types" } */
-extern foo4(); /* { dg-message "note: previous declaration" } */
-void foo4() {} /* { dg-error "conflicting types" } */
+extern foo4(); /* { dg-message "8:note: previous declaration" } */
+void foo4() {} /* { dg-error "6:conflicting types" } */
-extern void foo5(); /* { dg-message "note: previous declaration" } */
-foo5() {} /* { dg-warning "conflicting types" } */
+extern void foo5(); /* { dg-message "13:note: previous declaration" } */
+foo5() {} /* { dg-warning "1:conflicting types" } */
-foo6() {} /* { dg-message "note: previous definition" } */
-extern void foo6(); /* { dg-error "conflicting types" } */
+foo6() {} /* { dg-message "1:note: previous definition" } */
+extern void foo6(); /* { dg-error "13:conflicting types" } */
-foo7() {} /* { dg-message "note: previous definition" } */
-void foo7() {} /* { dg-error "conflicting types" } */
+foo7() {} /* { dg-message "1:note: previous definition" } */
+void foo7() {} /* { dg-error "6:conflicting types" } */
-void foo8() {} /* { dg-message "note: previous definition" } */
-foo8() {} /* { dg-error "conflicting types" } */
+void foo8() {} /* { dg-message "6:note: previous definition" } */
+foo8() {} /* { dg-error "1:conflicting types" } */
int use9() { foo9(); } /* { dg-message "note: previous implicit declaration" } */
-extern void foo9(); /* { dg-warning "conflicting types" } */
+extern void foo9(); /* { dg-warning "13:conflicting types" } */
int use10() { foo10(); } /* { dg-message "note: previous implicit declaration" } */
-void foo10() {} /* { dg-warning "conflicting types" } */
+void foo10() {} /* { dg-warning "6:conflicting types" } */
diff --git a/gcc/testsuite/gcc.dg/always_inline.c b/gcc/testsuite/gcc.dg/always_inline.c
index 3233741..08119f1 100644
--- a/gcc/testsuite/gcc.dg/always_inline.c
+++ b/gcc/testsuite/gcc.dg/always_inline.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2" } */
#include <stdarg.h>
inline __attribute__ ((always_inline)) void
-e(int t, ...)
-{ /* { dg-message "sorry\[^\n\]*variable argument" "" } */
+e(int t, ...) /* { dg-message "sorry\[^\n\]*variable argument" "" } */
+{
va_list q;
va_start (q, t);
}
diff --git a/gcc/testsuite/gcc.dg/always_inline3.c b/gcc/testsuite/gcc.dg/always_inline3.c
index db06843..97c80aa 100644
--- a/gcc/testsuite/gcc.dg/always_inline3.c
+++ b/gcc/testsuite/gcc.dg/always_inline3.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2" } */
int do_something_evil (void);
inline __attribute__ ((always_inline)) void
-q2(void)
-{ /* { dg-message "sorry\[^\n\]*recursive" "" } */
+q2(void) /* { dg-message "sorry\[^\n\]*recursive" "" } */
+{
if (do_something_evil ())
return;
q2(); /* { dg-message "sorry\[^\n\]*called from here" "" } */
diff --git a/gcc/testsuite/gcc.dg/inline-14.c b/gcc/testsuite/gcc.dg/inline-14.c
index 15b2d40..b2bfb67 100644
--- a/gcc/testsuite/gcc.dg/inline-14.c
+++ b/gcc/testsuite/gcc.dg/inline-14.c
@@ -2,8 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-std=c99" } */
-extern inline int func1 (void)
-{ /* { dg-message "note: previous definition" } */
+extern inline int func1 (void) /* { dg-message "note: previous definition" } */
+{
return 1;
}
@@ -12,8 +12,8 @@ inline int func1 (void) /* { dg-error "redefinition" } */
return 1;
}
-inline int func2 (void)
-{ /* { dg-message "note: previous definition" } */
+inline int func2 (void) /* { dg-message "note: previous definition" } */
+{
return 2;
}
diff --git a/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc/testsuite/gcc.dg/noreturn-1.c
index 3bd6a26..1e7a778 100644
--- a/gcc/testsuite/gcc.dg/noreturn-1.c
+++ b/gcc/testsuite/gcc.dg/noreturn-1.c
@@ -25,8 +25,8 @@ foo3(void)
extern void foo4(void);
void
-foo4(void)
-{ /* { dg-warning "candidate for attribute 'noreturn'" "detect noreturn candidate" } */
+foo4(void) /* { dg-warning "candidate for attribute 'noreturn'" "detect noreturn candidate" } */
+{
exit(0);
}
diff --git a/gcc/testsuite/gcc.dg/noreturn-4.c b/gcc/testsuite/gcc.dg/noreturn-4.c
index 5bc78ab..bcc29da 100644
--- a/gcc/testsuite/gcc.dg/noreturn-4.c
+++ b/gcc/testsuite/gcc.dg/noreturn-4.c
@@ -4,7 +4,7 @@
extern void exit (int) __attribute__ ((__noreturn__));
int
-main (void)
-{ /* { dg-warning "function might be possible candidate for attribute 'noreturn'" "warn for main" } */
+main (void) /* { dg-warning "function might be possible candidate for attribute 'noreturn'" "warn for main" } */
+{
exit (0);
}
diff --git a/gcc/testsuite/gcc.dg/noreturn-7.c b/gcc/testsuite/gcc.dg/noreturn-7.c
index 8ae5e23..1913be1f 100644
--- a/gcc/testsuite/gcc.dg/noreturn-7.c
+++ b/gcc/testsuite/gcc.dg/noreturn-7.c
@@ -13,8 +13,8 @@ void _exit(int status) __attribute__ ((__noreturn__));
int z = 0;
-void g()
-{ /* { dg-warning "possible candidate" } */
+void g() /* { dg-warning "possible candidate" } */
+{
if (++z > 10)
_exit(0);
g();
@@ -27,15 +27,15 @@ void f()
f();
} /* { dg-bogus "does return" } */
-int h()
-{ /* { dg-warning "possible candidate" } */
+int h() /* { dg-warning "possible candidate" } */
+{
if (++z > 10)
_exit(0);
return h();
} /* { dg-bogus "end of non-void function" } */
-int k()
-{ /* { dg-warning "possible candidate" } */
+int k() /* { dg-warning "possible candidate" } */
+{
if (++z > 10)
_exit(0);
k();
diff --git a/gcc/testsuite/gcc.dg/winline-3.c b/gcc/testsuite/gcc.dg/winline-3.c
index ce9e080..d586cba 100644
--- a/gcc/testsuite/gcc.dg/winline-3.c
+++ b/gcc/testsuite/gcc.dg/winline-3.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2 --param max-inline-insns-single=1" } */
void big (void);
-inline int q(void)
-{ /* { dg-warning "max-inline-insns-single" "" } */
+inline int q(void) /* { dg-warning "max-inline-insns-single" "" } */
+{
big();
big();
big();
diff --git a/gcc/testsuite/gcc.dg/winline-5.c b/gcc/testsuite/gcc.dg/winline-5.c
index 57fa393..ad1fc41 100644
--- a/gcc/testsuite/gcc.dg/winline-5.c
+++ b/gcc/testsuite/gcc.dg/winline-5.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2 --param inline-unit-growth=0 --param large-unit-insns=0" } */
void big (void);
-inline int q(void)
-{ /* { dg-warning "inline-unit-growth" } */
+inline int q(void) /* { dg-warning "inline-unit-growth" } */
+{
big();
big();
big();
diff --git a/gcc/testsuite/gcc.dg/winline-6.c b/gcc/testsuite/gcc.dg/winline-6.c
index dd8d3a8..4e22ce1 100644
--- a/gcc/testsuite/gcc.dg/winline-6.c
+++ b/gcc/testsuite/gcc.dg/winline-6.c
@@ -2,8 +2,8 @@
/* { dg-options "-Winline -O2 --param large-function-growth=0 --param large-function-insns=1" } */
void big (void);
-inline int q(void)
-{ /* { dg-warning "large-function-growth" } */
+inline int q(void) /* { dg-warning "large-function-growth" } */
+{
big();
big();
big();
diff --git a/gcc/testsuite/gcc.dg/winline-7.c b/gcc/testsuite/gcc.dg/winline-7.c
index bab82a2..19262da 100644
--- a/gcc/testsuite/gcc.dg/winline-7.c
+++ b/gcc/testsuite/gcc.dg/winline-7.c
@@ -4,8 +4,8 @@
extern void *alloca (__SIZE_TYPE__);
void big (void);
-inline void *q (void)
-{ /* { dg-warning "(function not inlinable|alloca)" } */
+inline void *q (void) /* { dg-warning "(function not inlinable|alloca)" } */
+{
return alloca (10);
}
inline void *t (void)
diff --git a/gcc/testsuite/gcc.dg/winline-9.c b/gcc/testsuite/gcc.dg/winline-9.c
index f6cd237..fddf5c6 100644
--- a/gcc/testsuite/gcc.dg/winline-9.c
+++ b/gcc/testsuite/gcc.dg/winline-9.c
@@ -10,8 +10,8 @@ int aa (void)
test(t);
}
static inline
-int bb (void)
-{ /* { dg-warning "large-stack-frame" "" } */
+int bb (void) /* { dg-warning "large-stack-frame" "" } */
+{
char t[100];
test(t);
}
diff --git a/gcc/testsuite/gcc.dg/wtr-func-def-1.c b/gcc/testsuite/gcc.dg/wtr-func-def-1.c
index 32d613e..049e05b 100644
--- a/gcc/testsuite/gcc.dg/wtr-func-def-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-func-def-1.c
@@ -6,8 +6,8 @@
/* Test some simple cases. */
-void f_void1 (void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_void1 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -16,8 +16,8 @@ void f_void2 ()
return;
}
-void f_int1 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int1 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -29,8 +29,8 @@ void f_int2 (f)
/* Test that we don't ever warn about nested functions. */
-void f_int3 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int3 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
void f3a (void) { return; }
void f3b () { return; }
void f3c (int f) { return; }
@@ -39,8 +39,8 @@ void f_int3 (int f)
return;
}
-void f_int4 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int4 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
void f4a (void) { return; }
void f4b () { return; }
void f4c (int f) { return; }
@@ -77,14 +77,14 @@ void f_int6 (f)
are still warned about. */
extern void f_int_p1 (int);
-void f_int_p1 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int_p1 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
extern void f_int_p2 (int f);
-void f_int_p2 (int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_int_p2 (int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -103,14 +103,14 @@ void f_int_p4 (f)
}
extern void f_void_p1 ();
-void f_void_p1 (void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_void_p1 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
extern void f_void_p2 (void);
-void f_void_p2 (void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_void_p2 (void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -133,39 +133,39 @@ f_impl1()
return 0;
}
-f_impl2(void)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+f_impl2(void) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}
-f_impl3(int f)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+f_impl3(int f) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}
/* Test stdarg functions. */
-f_stdarg1(const char *s, ...)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+f_stdarg1(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}
-void f_stdarg2(const char *s, ...)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_stdarg2(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
extern void f_stdarg3(const char *, ...);
-void f_stdarg3(const char *s, ...)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_stdarg3(const char *s, ...) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
/* Test handling function pointer parameters. */
void f_fnptr1 (int f, int (*fp)(int));
-void f_fnptr1 (int f, int (*fp)(int))
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+void f_fnptr1 (int f, int (*fp)(int)) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return;
}
@@ -180,8 +180,8 @@ void f_fnptr2 (f, fp)
/* Test for main. */
int
-main (int argc, char **argv)
-{ /* { dg-warning "traditional C rejects ISO C style" } */
+main (int argc, char **argv) /* { dg-warning "traditional C rejects ISO C style" } */
+{
return 0;
}