Commit 045a58e4 by Jason Merrill

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
parent 765189ff
......@@ -9,8 +9,8 @@ volatile int one = 1;
int
main ()
{
char a1[] = {one, 2, 3, 4};
char a2[] = {1, 2*one, 3, 4};
char a1[] = {(char)one, 2, 3, 4};
char a2[] = {1, (char)(2*one), 3, 4};
int res = memcmp (a1, a2, 5 + one);
return res;
}
......
......@@ -7,8 +7,8 @@ volatile int one = 1;
int
main ()
{
volatile char a1[] = {one, 2, 3, 4};
volatile char a2[] = {1, 2*one, 3, 4};
volatile char a1[] = {(char)one, 2, 3, 4};
volatile char a2[] = {1, (char)(2*one), 3, 4};
volatile int res = memcmp ((void *)a1,(void *)a2, 5 + one);
return 0;
}
......
......@@ -2,7 +2,7 @@
#define vector __attribute__((vector_size(8*sizeof(short))))
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 r1,r2,r3,r4;
int i = 8;
......
......@@ -11,7 +11,7 @@ struct S
struct S tests[] = {
{ { 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 }, { 0, 0 }, { A, A } },
{ { X, Y }, { 1, 1 }, { Y, Y } },
......
// { dg-do run }
// { dg-options "-std=c++98" }
#include <vector>
#include <memory>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment