diff options
author | Bernd Schmidt <bernds@redhat.co.uk> | 2000-10-17 09:34:21 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2000-10-17 09:34:21 +0000 |
commit | 2683ed8d12f52394b5eb7635af05bec68064ea58 (patch) | |
tree | 9a9bf64517120736c23b7a0ecdb4c40f71e7b674 /gcc/testsuite | |
parent | 9ece379a8a290603ecbafcd30dac259fc7c880a4 (diff) | |
download | gcc-2683ed8d12f52394b5eb7635af05bec68064ea58.zip gcc-2683ed8d12f52394b5eb7635af05bec68064ea58.tar.gz gcc-2683ed8d12f52394b5eb7635af05bec68064ea58.tar.bz2 |
Improved sequence point warnings
From-SVN: r36901
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/sequence-pt-1.c | 23 |
2 files changed, 24 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 04e3adb..65aadee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2000-10-17 Bernd Schmidt <bernds@redhat.co.uk> + + * gcc.dg/sequence-pt-1.c: Several new tests; remove xfail from some old tests. + 2000-10-17 Joseph S. Myers <jsm28@cam.ac.uk> * gcc.dg/format-miss-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/sequence-pt-1.c b/gcc/testsuite/gcc.dg/sequence-pt-1.c index f5738b9..022a998 100644 --- a/gcc/testsuite/gcc.dg/sequence-pt-1.c +++ b/gcc/testsuite/gcc.dg/sequence-pt-1.c @@ -11,6 +11,8 @@ struct s }; extern int fn (int); +extern int fnb (int, int); +extern int fnc (int *); extern int sprintf (char *, const char *, ...); void @@ -18,11 +20,11 @@ foo (int a, int b, int n, int p, int *ptr, struct s *sptr, int *ap, int *bp, int **cp, char *ans) { int len; + a = a++; /* { dg-warning "undefined" "sequence point warning" } */ a = --a; /* { dg-warning "undefined" "sequence point warning" } */ a = ++a + b; /* { dg-warning "undefined" "sequence point warning" } */ a = a-- + b; /* { dg-warning "undefined" "sequence point warning" } */ - a = (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" { xfail *-*-* } } */ ap[n] = bp[n++]; /* { dg-warning "undefined" "sequence point warning" } */ ap[--n] = bp[n]; /* { dg-warning "undefined" "sequence point warning" } */ ap[++n] = bp[--n]; /* { dg-warning "undefined" "sequence point warning" } */ @@ -31,12 +33,27 @@ foo (int a, int b, int n, int p, int *ptr, struct s *sptr, *ptr++ = (int)ptr++; /* { dg-warning "undefined" "sequence point warning" } */ sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" { xfail *-*-* } } */ sptr->a = (int)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */ - len = sprintf (ans, "%d", len++); /* { dg-bogus "undefined" "bogus sequence point warning" { xfail *-*-* } } */ - *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" { xfail *-*-* } } */ + *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" } */ a = b = a++; /* { dg-warning "undefined" "sequence point warning" } */ b = a = --b; /* { dg-warning "undefined" "sequence point warning" } */ a = 1 + (a = 1); /* { dg-warning "undefined" "sequence point warning" } */ a = (a = b); /* { dg-warning "undefined" "sequence point warning" } */ a = (a = b) + 1; /* { dg-warning "undefined" "sequence point warning" } */ a = (bp[a++] = b) + 1; /* { dg-warning "undefined" "sequence point warning" } */ + a = b++ * b++; /* { dg-warning "undefined" "sequence point warning" } */ + a = fnb (b++, b++); /* { dg-warning "undefined" "sequence point warning" } */ + *ap = fnc (ap++); /* { dg-warning "undefined" "sequence point warning" } */ + (a += b) + (a += n); /* { dg-warning "undefined" "sequence point warning" } */ + a = (b, b++) + (b++, b); /* { dg-warning "undefined" "sequence point warning" } */ + + a = (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + len = sprintf (ans, "%d", len++); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = fn (a++); /* { dg-bogus "undefined" "sequence point warning" } */ + (a = b++), (a = b++); /* { dg-bogus "undefined" "sequence point warning" } */ + a = (b++, b++); /* { dg-bogus "undefined" "sequence point warning" } */ + a = b++ && b++; /* { dg-bogus "undefined" "sequence point warning" } */ + a = b++ || b++; /* { dg-bogus "undefined" "sequence point warning" } */ + a = (b++ ? b++ : a); /* { dg-bogus "undefined" "sequence point warning" } */ + a = (b++ ? a : b++); /* { dg-bogus "undefined" "sequence point warning" } */ + ap[a++] += bp[b]; /* { dg-bogus "undefined" "sequence point warning" } */ } |