~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to memcheck/tests/s390x/cs.c

  • Committer: Benjamin Kerensa
  • Date: 2012-11-21 23:57:58 UTC
  • mfrom: (1.1.16)
  • Revision ID: bkerensa@ubuntu.com-20121121235758-bd1rv5uc5vzov2p6
Merge from debian unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdint.h>
 
2
#include <stdio.h>
 
3
#include <string.h>
 
4
 
 
5
void 
 
6
test(int32_t op1_init, int32_t op2_init, int32_t op3_init)
 
7
{
 
8
   register int32_t op1 asm("8") = op1_init;
 
9
   register int32_t op3 asm("9") = op3_init;
 
10
   
 
11
   int32_t op2 = op2_init;
 
12
   int cc = 1; 
 
13
 
 
14
   __asm__ volatile (
 
15
           "cs      8,9,%1\n\t"
 
16
           "ipm     %0\n\t"
 
17
           "srl     %0,28\n\t"
 
18
           : "=d" (cc), "+Q" (op2), "+d"(op1), "+d"(op3)
 
19
           : 
 
20
           : "cc");
 
21
}
 
22
 
 
23
int main ()
 
24
{
 
25
   int op1, op2, op3;
 
26
 
 
27
   test(op1, 0x10000000, 0x12345678);   // complaint
 
28
   test(0x10000000, op2, 0x12345678);   // complaint
 
29
   test(0x10000000, 0x01000000, op3);   // no complaint
 
30
 
 
31
   return 0;
 
32
}