mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-11 01:30:55 +08:00
gcc/
* doc/sourcebuild.texi (Test Directives) Add dg-message. gcc/testsuite/ * lib/gcc-dg.exp(process_message): New proc. (dg-message): New test directive. * gcc.dg/always_inline.c: Use dg-message. * gcc.dg/always_inline2.c: Ditto. * gcc.dg/always_inline3.c: Ditto. * gcc.dg/invalid-call-1.c: Ditto. * gcc.dg/pr17506.c: Ditto. * gcc.dg/simd-5.c: Ditto. * gcc.dg/simd-6.c: Ditto. * gcc.dg/va-arg-2.c: Ditto. * gcc.dg/cpp/syshdr.c: Ditto. * gcc.dg/cpp/unc4.c: Ditto. * gcc.dg/cpp/trad/mi1.c: Ditto. * gcc.dg/cpp/trad/mi5.c: Ditto. * gcc.dg/cpp/trad/mi7.c: Ditto. * gcc.test-framework/dg-outexistsnot-exp-P.c: Ditto. * gcc.test-framework/dg-outexists-exp-F.c: Ditto. * gcc.test-framework/test-framework.awk: Special-case outexists tests. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r124952
This commit is contained in:
parent
1f801ab788
commit
ba2f32a925
@ -1,3 +1,7 @@
|
||||
2007-05-22 Janis Johnson <janis187@us.ibm.com>
|
||||
|
||||
* doc/sourcebuild.texi (Test Directives) Add dg-message.
|
||||
|
||||
2007-05-22 H.J. Lu <hongjiu.lu@intel.com>
|
||||
Richard Henderson <rth@redhat.com>
|
||||
|
||||
|
@ -1016,6 +1016,12 @@ message is not matched by @var{regexp} then the check fails and
|
||||
@var{comment} is included in the @code{FAIL} message. The check does
|
||||
not look for the string @samp{"warning"} unless it is part of @var{regexp}.
|
||||
|
||||
@item @{ dg-message @var{regexp} [@var{comment} [@{ target/xfail @var{selector} @} [@var{line}] @}]] @}
|
||||
The line is expected to get a message other than an error or warning.
|
||||
If there is no message for that line or if the text of that message is
|
||||
not matched by @var{regexp} then the check fails and @var{comment} is
|
||||
included in the @code{FAIL} message.
|
||||
|
||||
@item @{ dg-bogus @var{regexp} [@var{comment} [@{ target/xfail @var{selector} @} [@var{line}] @}]] @}
|
||||
This DejaGnu directive appears on a source line that should not get a
|
||||
message matching @var{regexp}, or else specifies the source line
|
||||
|
@ -1,3 +1,26 @@
|
||||
2007-05-22 Janis Johnson <janis187@us.ibm.com>
|
||||
Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
||||
|
||||
* lib/gcc-dg.exp(process_message): New proc.
|
||||
(dg-message): New test directive.
|
||||
* gcc.dg/always_inline.c: Use dg-message.
|
||||
* gcc.dg/always_inline2.c: Ditto.
|
||||
* gcc.dg/always_inline3.c: Ditto.
|
||||
* gcc.dg/invalid-call-1.c: Ditto.
|
||||
* gcc.dg/pr17506.c: Ditto.
|
||||
* gcc.dg/simd-5.c: Ditto.
|
||||
* gcc.dg/simd-6.c: Ditto.
|
||||
* gcc.dg/va-arg-2.c: Ditto.
|
||||
* gcc.dg/cpp/syshdr.c: Ditto.
|
||||
* gcc.dg/cpp/unc4.c: Ditto.
|
||||
* gcc.dg/cpp/trad/mi1.c: Ditto.
|
||||
* gcc.dg/cpp/trad/mi5.c: Ditto.
|
||||
* gcc.dg/cpp/trad/mi7.c: Ditto.
|
||||
* gcc.test-framework/dg-outexistsnot-exp-P.c: Ditto.
|
||||
* gcc.test-framework/dg-outexists-exp-F.c: Ditto.
|
||||
* gcc.test-framework/test-framework.awk: Special-case outexists
|
||||
tests.
|
||||
|
||||
2007-05-22 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* gcc.dg/i386-cpuid.h (bit_SSE4_1): New.
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <stdarg.h>
|
||||
inline __attribute__ ((always_inline)) void
|
||||
e(int t, ...)
|
||||
{ /* { dg-error "variable argument" "" } */
|
||||
{ /* { dg-message "variable argument" "" } */
|
||||
va_list q;
|
||||
va_start (q, t);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Winline -O2" } */
|
||||
inline __attribute__ ((always_inline)) void t(void); /* { dg-error "body not available" "" } */
|
||||
inline __attribute__ ((always_inline)) void t(void); /* { dg-message "body not available" "" } */
|
||||
void
|
||||
q(void)
|
||||
{
|
||||
t(); /* { dg-error "called from here" "" } */
|
||||
t(); /* { dg-message "called from here" "" } */
|
||||
}
|
||||
|
@ -3,9 +3,9 @@
|
||||
int do_something_evil (void);
|
||||
inline __attribute__ ((always_inline)) void
|
||||
q2(void)
|
||||
{ /* { dg-error "recursive" "" } */
|
||||
{ /* { dg-message "recursive" "" } */
|
||||
if (do_something_evil ())
|
||||
return;
|
||||
q2(); /* { dg-error "called from here" "" } */
|
||||
q2(); /* { dg-message "called from here" "" } */
|
||||
q2(); /* With -O2 we don't warn here, it is eliminated by tail recursion. */
|
||||
}
|
||||
|
@ -8,5 +8,5 @@
|
||||
/* { dg-do preprocess } */
|
||||
/* { dg-error "include_next" "good error" { target *-*-* } 4 } */
|
||||
|
||||
#include "syshdr1.h" /* { dg-error "" "In file included from:" } */
|
||||
#include "syshdr1.h" /* { dg-message "" "In file included from:" } */
|
||||
#include "syshdr2.h"
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
/* { dg-do compile }
|
||||
{ dg-options "-H -traditional-cpp" }
|
||||
{ dg-error "mi1c\.h\n\[^\n\]*mi1nd\.h\n\[^\n\]*mi1ndp\.h\n\[^\n\]*mi1x\.h" "redundant include check" { target *-*-* } 0 } */
|
||||
{ dg-message "mi1c\.h\n\[^\n\]*mi1nd\.h\n\[^\n\]*mi1ndp\.h\n\[^\n\]*mi1x\.h" "redundant include check" { target *-*-* } 0 } */
|
||||
|
||||
#include "mi1c.h"
|
||||
#include "mi1c.h"
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
/* { dg-do preprocess }
|
||||
{ dg-options "-H -C -traditional-cpp" }
|
||||
{ dg-error "mi1c\.h" "redundant include check with -C" { target *-*-* } 0 } */
|
||||
{ dg-message "mi1c\.h" "redundant include check with -C" { target *-*-* } 0 } */
|
||||
|
||||
#include "mi1c.h"
|
||||
#include "mi1c.h"
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
/* { dg-do preprocess }
|
||||
{ dg-options "-H -traditional-cpp" }
|
||||
{ dg-error "mi7a\.h\n\[^\n\]*mi7a\.h\n\[^\n\]*mi7b\.h\n\[^\n\]*mi7b\.h" "redundant include check" { target *-*-* } 0 } */
|
||||
{ dg-message "mi7a\.h\n\[^\n\]*mi7a\.h\n\[^\n\]*mi7b\.h\n\[^\n\]*mi7b\.h" "redundant include check" { target *-*-* } 0 } */
|
||||
|
||||
#include "mi7a.h"
|
||||
#include "mi7a.h"
|
||||
|
@ -32,7 +32,7 @@ ignored
|
||||
message. */
|
||||
#define FOO
|
||||
#ifdef FOO /* { dg-bogus "unterminated" "nested unterm" } */
|
||||
#include "unc1.c" /* { dg-error "" } */
|
||||
#include "unc1.c" /* { dg-message "file included from" "" { target *-*-* } 0 } */
|
||||
#endif
|
||||
|
||||
/* dg.exp doesn't read the included files for tags, so we have to
|
||||
|
@ -13,5 +13,5 @@ char* cptr;
|
||||
void foo()
|
||||
{
|
||||
cptr = mar(6);
|
||||
((char *(*)(void *,int (*)(void *,unsigned char **),char**))((fp)bar))(0,0,(void*)(0)); /* { dg-warning "" "non-compatible type" } */
|
||||
((char *(*)(void *,int (*)(void *,unsigned char **),char**))((fp)bar))(0,0,(void*)(0)); /* { dg-message "" "non-compatible type" } */
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ void baz (void);
|
||||
void
|
||||
bar (void)
|
||||
{
|
||||
int j; /* { dg-error "note: 'j' was declared here" } */
|
||||
int j; /* { dg-message "note: 'j' was declared here" } */
|
||||
for (; foo (j); ++j)
|
||||
baz ();
|
||||
}
|
||||
|
@ -4,4 +4,5 @@
|
||||
/* Ensure that we don't need a typedef to initialize a vector type. */
|
||||
#define vector __attribute__ ((vector_size (8)))
|
||||
vector char x = (vector char) {1,2,3,4,5,6,7,8}; /* { dg-bogus "initializer" } */
|
||||
vector char y = (vector short) {1,2,3,4}; /* { dg-error "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*incompatible types in initialization" } */
|
||||
vector char y = (vector short) {1,2,3,4}; /* { dg-message "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
|
||||
/* { dg-error "incompatible types in initialization" "" { target *-*-* } 7 } */
|
||||
|
@ -4,4 +4,5 @@
|
||||
/* Ensure that we don't need a typedef to initialize a vector type. */
|
||||
#define vector __attribute__ ((vector_size (8)))
|
||||
vector char x = (vector char) {1,2,3,4,5,6,7,8}; /* { dg-bogus "initializer" } */
|
||||
vector char y = (vector short) {1,2,3,4}; /* { dg-error "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts.*incompatible types in initialization" } */
|
||||
vector char y = (vector short) {1,2,3,4}; /* { dg-message "use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts" } */
|
||||
/* { dg-message "incompatible types in initialization" "" { target *-*-* } 7 } */
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include <varargs.h> /* { dg-bogus "varargs.h" "missing file" } */
|
||||
|
||||
/* { dg-error "" "In file included from" { target *-*-* } 6 } */
|
||||
/* { dg-message "" "In file included from" { target *-*-* } 6 } */
|
||||
/* { dg-error "no longer implements" "#error 1" { target *-*-* } 4 } */
|
||||
/* { dg-error "Revise your code" "#error 2" { target *-*-* } 5 } */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wunused-value -Werror" } */
|
||||
|
||||
int main (void) { 0; } /* { dg-warning "no effect" } */
|
||||
int main (void) { 0; } /* { dg-error "no effect" } */
|
||||
|
||||
/* { dg-warning "warnings being treated as errors" "" { target *-*-* } 0 } */
|
||||
/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */
|
||||
/* { dg-final { output-exists { target *-*-* } } } */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wunused-value -Werror" } */
|
||||
|
||||
int main (void) { 0; } /* { dg-warning "no effect" } */
|
||||
int main (void) { 0; } /* { dg-error "no effect" } */
|
||||
|
||||
/* { dg-warning "warnings being treated as errors" "" { target *-*-* } 0 } */
|
||||
/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */
|
||||
/* { dg-final { output-exists-not { target *-*-* } } } */
|
||||
|
@ -46,6 +46,7 @@ BEGIN { skip = 1; passes = 0; fails = 0; }
|
||||
# ignore compile step, tests for warnings for output-exists[-not] tests.
|
||||
/dg-outexists.*\(test for excess errors)/ { ignore(); next }
|
||||
/dg-outexists.*\(test for warnings/ { ignore(); next }
|
||||
/dg-outexists.*\(test for errors/ { ignore(); next }
|
||||
# The other dox tests pass the compile step; ignore that message.
|
||||
/^PASS.*dox.*\(test for excess errors\)/ { ignore(); next }
|
||||
# The sf tests pass the compile step; ignore that message.
|
||||
|
@ -559,4 +559,40 @@ if { [info procs saved-dg-test] == [list] } {
|
||||
}
|
||||
}
|
||||
|
||||
# Modify the regular expression saved by a DejaGnu message directive to
|
||||
# include a prefix and to force the expression to match a single line.
|
||||
# MSGPROC is the procedure to call.
|
||||
# MSGPREFIX is the prefix to prepend.
|
||||
# DGARGS is the original argument list.
|
||||
|
||||
proc process-message { msgproc msgprefix dgargs } {
|
||||
upvar dg-messages dg-messages
|
||||
|
||||
# Process the dg- directive, including adding the regular expression
|
||||
# to the new message entry in dg-messages.
|
||||
set msgcnt [llength ${dg-messages}]
|
||||
catch { eval $msgproc $dgargs }
|
||||
|
||||
# If the target expression wasn't satisfied there is no new message.
|
||||
if { [llength ${dg-messages}] == $msgcnt } {
|
||||
return;
|
||||
}
|
||||
|
||||
# Prepend the message prefix to the regular expression and make
|
||||
# it match a single line.
|
||||
set newentry [lindex ${dg-messages} end]
|
||||
set expmsg [lindex $newentry 2]
|
||||
set expmsg "$msgprefix\[^\n]*$expmsg"
|
||||
set newentry [lreplace $newentry 2 2 $expmsg]
|
||||
set dg-messages [lreplace ${dg-messages} end end $newentry]
|
||||
verbose "process-message:\n${dg-messages}" 2
|
||||
}
|
||||
|
||||
# Look for messages that don't have standard prefixes.
|
||||
|
||||
proc dg-message { args } {
|
||||
upvar dg-messages dg-messages
|
||||
process-message dg-warning "" $args
|
||||
}
|
||||
|
||||
set additional_prunes ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user