summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/sve_popcount_1_run.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/aarch64/sve_popcount_1_run.c')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve_popcount_1_run.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/sve_popcount_1_run.c b/gcc/testsuite/gcc.target/aarch64/sve_popcount_1_run.c
index 9ef47bcbf2c..6be828fa81a 100644
--- a/gcc/testsuite/gcc.target/aarch64/sve_popcount_1_run.c
+++ b/gcc/testsuite/gcc.target/aarch64/sve_popcount_1_run.c
@@ -1,5 +1,5 @@
/* { dg-do run { target aarch64_sve_hw } } */
-/* { dg-options "-O2 -ftree-vectorize -fno-inline -march=armv8-a+sve" } */
+/* { dg-options "-O2 -ftree-vectorize -march=armv8-a+sve" } */
#include "sve_popcount_1.c"
@@ -16,24 +16,31 @@ unsigned int data[] = {
0x0, 0
};
-int
+int __attribute__ ((optimize (1)))
main (void)
{
unsigned int count = sizeof (data) / sizeof (data[0]) / 2;
- unsigned int in32[count], out32[count];
+ uint32_t in32[count];
+ unsigned int out32[count];
for (unsigned int i = 0; i < count; ++i)
- in32[i] = data[i * 2];
+ {
+ in32[i] = data[i * 2];
+ asm volatile ("" ::: "memory");
+ }
popcount_32 (out32, in32, count);
for (unsigned int i = 0; i < count; ++i)
if (out32[i] != data[i * 2 + 1])
abort ();
count /= 2;
- unsigned long in64[count];
+ uint64_t in64[count];
unsigned int out64[count];
for (unsigned int i = 0; i < count; ++i)
- in64[i] = ((unsigned long) data[i * 4] << 32) | data[i * 4 + 2];
+ {
+ in64[i] = ((uint64_t) data[i * 4] << 32) | data[i * 4 + 2];
+ asm volatile ("" ::: "memory");
+ }
popcount_64 (out64, in64, count);
for (unsigned int i = 0; i < count; ++i)
if (out64[i] != data[i * 4 + 1] + data[i * 4 + 3])