mirror of git://gcc.gnu.org/git/gcc.git
memcmp-1.c: Fix narrowing.
gcc/testsuite/ * c-c++-common/asan/memcmp-1.c: Fix narrowing. * c-c++-common/asan/no-asan-stack.c: Fix narrowing. * c-c++-common/torture/vector-shift1.c: Fix narrowing. * c-c++-common/torture/vshuf-2.inc: Fix narrowing. * g++.dg/torture/pr33572.C: Compile with -std=c++98. From-SVN: r222963
This commit is contained in:
parent
765189ff60
commit
045a58e455
|
|
@ -9,8 +9,8 @@ volatile int one = 1;
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
char a1[] = {one, 2, 3, 4};
|
char a1[] = {(char)one, 2, 3, 4};
|
||||||
char a2[] = {1, 2*one, 3, 4};
|
char a2[] = {1, (char)(2*one), 3, 4};
|
||||||
int res = memcmp (a1, a2, 5 + one);
|
int res = memcmp (a1, a2, 5 + one);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ volatile int one = 1;
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
volatile char a1[] = {one, 2, 3, 4};
|
volatile char a1[] = {(char)one, 2, 3, 4};
|
||||||
volatile char a2[] = {1, 2*one, 3, 4};
|
volatile char a2[] = {1, (char)(2*one), 3, 4};
|
||||||
volatile int res = memcmp ((void *)a1,(void *)a2, 5 + one);
|
volatile int res = memcmp ((void *)a1,(void *)a2, 5 + one);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#define vector __attribute__((vector_size(8*sizeof(short))))
|
#define vector __attribute__((vector_size(8*sizeof(short))))
|
||||||
|
|
||||||
int main (int argc, char *argv[]) {
|
int main (int argc, char *argv[]) {
|
||||||
vector short v0 = {argc,2,3,4,5,6,7};
|
vector short v0 = {(short)argc,2,3,4,5,6,7};
|
||||||
vector short v1 = {2,2,2,2,2,2,2};
|
vector short v1 = {2,2,2,2,2,2,2};
|
||||||
vector short r1,r2,r3,r4;
|
vector short r1,r2,r3,r4;
|
||||||
int i = 8;
|
int i = 8;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ struct S
|
||||||
|
|
||||||
struct S tests[] = {
|
struct S tests[] = {
|
||||||
{ { A, B }, { 0, 1 }, { A, B } },
|
{ { A, B }, { 0, 1 }, { A, B } },
|
||||||
{ { A, B }, { -16, -1 }, { A, B } },
|
{ { A, B }, { -16U, -1U }, { A, B } },
|
||||||
{ { A, B }, { 1, 0 }, { B, A } },
|
{ { A, B }, { 1, 0 }, { B, A } },
|
||||||
{ { A, B }, { 0, 0 }, { A, A } },
|
{ { A, B }, { 0, 0 }, { A, A } },
|
||||||
{ { X, Y }, { 1, 1 }, { Y, Y } },
|
{ { X, Y }, { 1, 1 }, { Y, Y } },
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
// { dg-do run }
|
// { dg-do run }
|
||||||
|
// { dg-options "-std=c++98" }
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue