Skip to content
Snippets Groups Projects
Commit 0dfb1bd9 authored by Martin Liska's avatar Martin Liska
Browse files

testsuite: fix ASAN errors

The tests failed on my machine as they contain out-of-bounds
access.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx2-psraq-1.c: Use ARRAY_SIZE.
	* gcc.target/i386/m128-check.h: Move it to the top-level
	context.
	* gcc.target/i386/sse2-psraq-1.c: Use ARRAY_SIZE.
	* gcc.target/i386/sse4_2-check.h: Include the header with
	ARRAY_SIZE definition.
parent b0e6a257
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ TEST (void)
V a = (V) { 0xdeadbeefcafebabeULL, 0x123456789abcdef0ULL,
0x173a74be8a95134cULL, 0x817bae35ac0ebf12ULL };
int i;
for (i = 0; tests[i].n; i++)
for (i = 0; i < ARRAY_SIZE (tests); i++)
{
V c = tests[i].fn (a);
if (c[0] != a[0] >> tests[i].n || c[1] != a[1] >> tests[i].n
......
#include <stdio.h>
#include <xmmintrin.h>
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(A) (sizeof (A) / sizeof ((A)[0]))
#endif
#ifdef __SSE2__
#include <emmintrin.h>
......@@ -66,10 +70,6 @@ typedef union
float a[4];
} union128;
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(A) (sizeof (A) / sizeof ((A)[0]))
#endif
#ifdef DEBUG
#define PRINTF printf
#else
......
......@@ -41,7 +41,7 @@ TEST (void)
V a = (V) { 0xdeadbeefcafebabeULL, 0x123456789abcdef0ULL };
V b = (V) { 0x173a74be8a95134cULL, 0x817bae35ac0ebf12ULL };
int i;
for (i = 0; tests[i].n; i++)
for (i = 0; i < ARRAY_SIZE (tests); i++)
{
V c = tests[i].fn (a);
if (c[0] != a[0] >> tests[i].n || c[1] != a[1] >> tests[i].n)
......
#include <stdio.h>
#include <stdlib.h>
#include "m128-check.h"
#include "cpuid.h"
static void sse4_2_test (void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment