re PR c++/28288 (ICE with min/max operator)

PR c++/28288
	PR c++/14556
	* g++.old-deja/g++.warn/compare1.C: Delete.
	* g++.dg/opt/pr7503-2.C: Delete.
	* g++.dg/opt/pr7503-3.C: Delete.
	* g++.dg/opt/pr7503-4.C: Delete.
	* g++.dg/opt/pr7503-5.C: Delete.
	* g++.dg/opt/max1.C: Delete.
	* g++.dg/warn/minmax.C: Delete.
	* g++.dg/expr/minmax.C: New test.

From-SVN: r116141
This commit is contained in:
Steve Ellcey 2006-08-14 23:15:57 +00:00 committed by Steve Ellcey
parent b52dbbf865
commit 9f4593a856
9 changed files with 27 additions and 347 deletions

View File

@ -1,3 +1,16 @@
2006-08-14 Steve Ellcey <sje@cup.hp.com>
PR c++/28288
PR c++/14556
* g++.old-deja/g++.warn/compare1.C: Delete.
* g++.dg/opt/pr7503-2.C: Delete.
* g++.dg/opt/pr7503-3.C: Delete.
* g++.dg/opt/pr7503-4.C: Delete.
* g++.dg/opt/pr7503-5.C: Delete.
* g++.dg/opt/max1.C: Delete.
* g++.dg/warn/minmax.C: Delete.
* g++.dg/expr/minmax.C: New test.
2006-08-14 Richard Guenther <rguenther@suse.de>
PR testsuite/28703

View File

@ -0,0 +1,14 @@
// { dg-do compile }
void f(void)
{
int a, b;
(a >? b) = 1; // { dg-error "" }
}
void g(void)
{
int a, b;
(a <? b) = 1; // { dg-error "" }
}

View File

@ -1,29 +0,0 @@
/* PR middle-end/19068 */
/* Test case by Andrew Pinski <pinskia@physics.uc.edu> */
/* { dg-do run } */
/* { dg-options "-O2 -Wno-deprecated" } */
extern "C" void abort (void);
long fff[10];
void f(long a)
{
int i;
a = *((long*)(a+1+sizeof(long))) >? *((long*)(a+1));
for(i=0;i<10;i++)
fff[i] = a;
}
int main(void)
{
int i;
long a[2] = {10,5};
f((long)(&a)-1);
for(i = 0;i<10;i++)
if (fff[i]!=10)
abort ();
return 0;
}

View File

@ -1,79 +0,0 @@
// PR c++/7503
// { dg-do run }
// { dg-options "-O2 -Wno-deprecated" }
extern "C" void abort();
void test1a()
{
int A = 4;
int B = 4;
(A >? B) = 1;
if (A != 1 || B != 4)
abort ();
}
void test1b()
{
int A = 3;
int B = 5;
(A >? B) = 1;
if (A != 3 || B != 1)
abort ();
}
void test1c()
{
int A = 5;
int B = 3;
(A >? B) = 1;
if (A != 1 || B != 3)
abort ();
}
void test2a()
{
int A = 4;
int B = 4;
(A <? B) = 1;
if (A != 1 || B != 4)
abort ();
}
void test2b()
{
int A = 3;
int B = 5;
(A <? B) = 1;
if (A != 1 || B != 5)
abort ();
}
void test2c()
{
int A = 5;
int B = 3;
(A <? B) = 1;
if (A != 5 || B != 1)
abort ();
}
int main()
{
test1a();
test1b();
test1c();
test2a();
test2b();
test2c();
return 0;
}

View File

@ -1,26 +0,0 @@
// PR c++/7503
// { dg-do compile }
// { dg-options "-O2 -Wno-deprecated" }
extern int A, B;
void test1()
{
(A++ <? B) = 0; // { dg-error "lvalue required" }
}
void test2()
{
(A <? B++) = 0; // { dg-error "lvalue required" }
}
void test3()
{
(A++ >? B) = 0; // { dg-error "lvalue required" }
}
void test4()
{
(A >? B++) = 0; // { dg-error "lvalue required" }
}

View File

@ -1,81 +0,0 @@
// PR c++/7503
// { dg-do run }
// { dg-options "-O2 -Wno-deprecated" }
extern "C" void abort();
void test1a()
{
int A = 4;
int B = 4;
A >?= B;
if (A != 4 || B != 4)
abort ();
}
void test1b()
{
int A = 3;
int B = 5;
A >?= B;
if (A != 5 || B != 5)
abort ();
}
void test1c()
{
int A = 5;
int B = 3;
A >?= B;
if (A != 5 || B != 3)
abort ();
}
void test2a()
{
int A = 4;
int B = 4;
A <?= B;
if (A != 4 || B != 4)
abort ();
}
void test2b()
{
int A = 3;
int B = 5;
A <?= B;
if (A != 3 || B != 5)
abort ();
}
void test2c()
{
int A = 5;
int B = 3;
A <?= B;
if (A != 3 || B != 3)
abort ();
}
int main()
{
test1a();
test1b();
test1c();
test2a();
test2b();
test2c();
return 0;
}

View File

@ -1,81 +0,0 @@
// PR c++/7503
// { dg-do run }
// { dg-options "-O2 -Wno-deprecated" }
extern "C" void abort();
void test1a()
{
int A = 4;
int B = 4;
A >?= B++;
if (A != 4 || B != 5)
abort ();
}
void test1b()
{
int A = 3;
int B = 5;
A >?= B++;
if (A != 5 || B != 6)
abort ();
}
void test1c()
{
int A = 5;
int B = 3;
A >?= B++;
if (A != 5 || B != 4)
abort ();
}
void test2a()
{
int A = 4;
int B = 4;
A <?= B++;
if (A != 4 || B != 5)
abort ();
}
void test2b()
{
int A = 3;
int B = 5;
A <?= B++;
if (A != 3 || B != 6)
abort ();
}
void test2c()
{
int A = 5;
int B = 3;
A <?= B++;
if (A != 3 || B != 4)
abort ();
}
int main()
{
test1a();
test1b();
test1c();
test2a();
test2b();
test2c();
return 0;
}

View File

@ -1,15 +0,0 @@
int i, j, k;
void f() {
i = j <? k; // { dg-warning "deprecated" }
i = j >? k; // { dg-warning "deprecated" }
i <?= j; // { dg-warning "deprecated" }
i >?= j; // { dg-warning "deprecated" }
}
struct S {
void operator<?(int); // { dg-warning "deprecated" }
void operator>?(int); // { dg-warning "deprecated" }
void operator<?=(int); // { dg-warning "deprecated" }
void operator>?=(int); // { dg-warning "deprecated" }
};

View File

@ -1,36 +0,0 @@
// { dg-do assemble }
// { dg-options "-ansi -pedantic-errors -Wsign-compare -Wno-deprecated" }
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 5/13/2001
int foo(int x, int y, unsigned u)
{
/* A MAX_EXPR is non-negative if EITHER argument to the MAX_EXPR is
determined to be non-negative. */
if (u < (x >? -1)) // { dg-warning "" } signed and unsigned
return x;
if (u < (x >? 10))
return x;
if ((10 >? x) < u)
return x;
if (u < (x >? (y ? (x==y) : 10)))
return x;
if (((y ? 10 : (x==y)) >? x) < u)
return x;
/* A MIN_EXPR is non-negative if BOTH arguments to the MIN_EXPR are
determined to be non-negative. */
if (u < ((x?11:8) <? -1)) // { dg-warning "" } signed and unsigned
return x;
if (u < ((x?11:8) <? 10))
return x;
if ((10 <? (x?8:11)) < u)
return x;
if (u < ((x?11:(x==y)) <? 10))
return x;
if ((10 <? (x?(x==y):11)) < u)
return x;
return 0;
}