none/tests/fdleak_cmsg_supp.supp: Add suppressions for older glibc
[valgrind.git] / none / tests / mips32 / unaligned_load_store.c
blobc3bf037b49e73911c19afd7b72c1780dd4531f1c
1 #include <stdio.h>
2 unsigned int mem[] = {
3 0xaabbccdd, 0x11223344, 0x01823194, 0x01823a08,
4 0x00000000, 0x77ff528c, 0x77deb460, 0x00000001
5 };
7 void printMem(char* s)
9 int i;
10 printf("%s\n", s);
11 for (i=0; i<7 ; i=i+1)
12 printf("mem[%d]: 0x%x\n", i, mem[i]);
15 int main ()
17 #if (__mips_isa_rev<6)
18 printMem("PRE lwl");
19 __asm__ volatile("move $a0, %0" "\n\t"
20 "lw $t0, 0($a0)" "\n\t"
21 "lwl $t0, 4($a0)" "\n\t"
22 "sw $t0, 8($a0)" "\n\t"
23 "lw $t1, 0($a0)" "\n\t"
24 "lwl $t1, 5($a0)" "\n\t"
25 "sw $t1, 12($a0)" "\n\t"
26 "lw $t2, 0($a0)" "\n\t"
27 "lwl $t2, 6($a0)" "\n\t"
28 "sw $t2, 16($a0)" "\n\t"
29 "lw $t3, 0($a0)" "\n\t"
30 "lwl $t3, 7($a0)" "\n\t"
31 "sw $t3, 20($a0)" "\n\t"
33 : "r" (mem)
34 : "a0", "t0", "t1", "t2", "t3", "cc", "memory"
36 printMem("POST lwl");
38 mem[0] = 0xaabbccdd;
39 mem[1] = 0x11223344;
40 mem[2] = 0x01823194;
41 mem[3] = 0x01823a08;
42 mem[4] = 0x00000000;
43 mem[5] = 0x77ff528c;
44 mem[6] = 0x77deb460;
45 mem[7] = 0x00000001;
47 printMem("PRE lwr");
48 __asm__ volatile("move $a0, %0" "\n\t"
49 "lw $t0, 0($a0)" "\n\t"
50 "lwr $t0, 4($a0)" "\n\t"
51 "sw $t0, 8($a0)" "\n\t"
52 "lw $t1, 0($a0)" "\n\t"
53 "lwr $t1, 5($a0)" "\n\t"
54 "sw $t1, 12($a0)" "\n\t"
55 "lw $t2, 0($a0)" "\n\t"
56 "lwr $t2, 6($a0)" "\n\t"
57 "sw $t2, 16($a0)" "\n\t"
58 "lw $t3, 0($a0)" "\n\t"
59 "lwr $t3, 7($a0)" "\n\t"
60 "sw $t3, 20($a0)" "\n\t"
62 : "r" (mem)
63 : "a0", "t0", "t1", "t2", "t3", "cc", "memory"
65 printMem("POST lwr");
66 #endif
67 return 0;