1 /* Machine description pattern tests. */
3 /* { dg-do compile } */
4 /* { dg-options "-mmvcle -dP -save-temps" } */
5 /* { dg-do run { target { s390_useable_hw } } } */
7 /* Skip test if -O0 is present on the command line or -O... is missing:
9 { dg-skip-if "" { *-*-* } { "-march=z9*" "-O0" } { "" } }
10 { dg-skip-if "" { *-*-* } { "*" } { "-O*" } }
13 __attribute__ ((noinline
))
14 void test(char *p
, char c
, int len
)
16 __builtin_memset(p
, c
, len
);
19 __attribute__ ((noinline
))
20 void test2(char *p
, int c
, int len
)
22 __builtin_memset(p
, (char)c
, len
);
25 /* Check that the right patterns are used. */
26 /* { dg-final { scan-assembler-times {c"?:16:.*{[*]setmem_long_?3?1?z?}} 1 } } */
27 /* { dg-final { scan-assembler-times {c"?:22:.*{[*]setmem_long_and_?3?1?z?}} 1 } } */
37 for (i
= 1; i
<= LEN
; i
++)
38 buf
[i
] = (0x10 + (i
& 0x3f));
42 void validate_buf(char val
)
48 for (i
= 1; i
<= LEN
; i
++)
51 if (buf
[LEN
+ 1] != 0x7f)
58 test(buf
+ 1, 55, LEN
);
61 test(buf
+ 1, 66, LEN
);