S/390: Make tests expect column numbers in RTL output
[official-gcc.git] / gcc / testsuite / gcc.target / s390 / md / setmem_long-1.c
bloba1d1c11df37b87894b0fa221fdc2fef5fb95f174
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 } } */
29 #define LEN 500
30 char buf[LEN + 2];
32 void init_buf(void)
34 int i;
36 buf[0] = 0;
37 for (i = 1; i <= LEN; i++)
38 buf[i] = (0x10 + (i & 0x3f));
39 buf[LEN + 1] = 0x7f;
42 void validate_buf(char val)
44 int i;
46 if (buf[0] != 0)
47 __builtin_abort();
48 for (i = 1; i <= LEN; i++)
49 if (buf[i] != val)
50 __builtin_abort();
51 if (buf[LEN + 1] != 0x7f)
52 __builtin_abort();
55 int main(void)
57 init_buf();
58 test(buf + 1, 55, LEN);
59 validate_buf(55);
60 init_buf();
61 test(buf + 1, 66, LEN);
62 validate_buf(66);