Debian Codegraph @

gcc/testsuite/gcc.target/alpha/memclr-a2-o1-c9-ptr.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mbwx -mno-safe-partial" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" } } */
4
5 typedef unsigned int __attribute__ ((mode (QI))) int08_t;
6 typedef unsigned int __attribute__ ((mode (HI))) int16_t;
7
8 typedef struct
9 {
10 int08_t v[9];
11 }
12 s_t;
13
14 typedef union
15 {
16 struct
17 {
18 int08_t c[1];
19 s_t s;
20 int08_t d[6];
21 };
22 int16_t a;
23 }
24 u_t;
25
26 void __attribute__ ((noinline))
27 memclr_a2_o1_c9 (u_t *u)
28 {
29 u->s = (s_t) { 0 };
30 }
31
32 /* Expect assembly such as:
33
34 ldq_u $2,9($16)
35 stb $31,1($16)
36 lda $3,2($16)
37 ldq_u $1,2($16)
38 mskqh $2,$3,$2
39 stq_u $2,9($16)
40 mskql $1,$3,$1
41 stq_u $1,2($16)
42
43 that is with a byte store at offset 1 and with two unaligned load/store
44 pairs at offsets 2 and 9 each. */
45
46 /* { dg-final { scan-assembler-times "\\sldq_u\\s\\\$\[0-9\]+,2\\\(\\\$16\\\)\\s" 1 } } */
47 /* { dg-final { scan-assembler-times "\\sldq_u\\s\\\$\[0-9\]+,9\\\(\\\$16\\\)\\s" 1 } } */
48 /* { dg-final { scan-assembler-times "\\sstb\\s\\\$31,1\\\(\\\$16\\\)\\s" 1 } } */
49 /* { dg-final { scan-assembler-times "\\sstq_u\\s\\\$\[0-9\]+,2\\\(\\\$16\\\)\\s" 1 } } */
50 /* { dg-final { scan-assembler-times "\\sstq_u\\s\\\$\[0-9\]+,9\\\(\\\$16\\\)\\s" 1 } } */