1 /* { dg-do compile } */ 2 /* { dg-options "-O3" } */ 3 4 #include <stdint.h> 5 6 #define TEST(TYPE, CONST) \ 7 void \ 8 set_##TYPE (TYPE *dst, int count) \ 9 { \ 10 for (int i = 0; i < count; ++i) \ 11 dst[i] = CONST; \ 12 } 13 14 TEST (uint16_t, 0x1234) 15 TEST (uint32_t, 0x1234) 16 TEST (uint64_t, 0x1234) 17 18 /* { dg-final { scan-assembler {\tmov\t(w[0-9]+), 4660\n[^:]*\tmov\tz[0-9]+\.h, \1\n} } } */ 19 /* { dg-final { scan-assembler {\tmov\t(w[0-9]+), 4660\n[^:]*\tmov\tz[0-9]+\.s, \1\n} } } */ 20 /* { dg-final { scan-assembler {\tmov\t(x[0-9]+), 4660\n[^:]*\tmov\tz[0-9]+\.d, \1\n} } } */ 21