none/tests/fdleak_cmsg_supp.supp: Add suppressions for older glibc
[valgrind.git] / none / tests / amd64 / jrcxz.c
blob4d70734c25acd53b53ec6d9f30bc510e987a7fa1
2 #include <stdio.h>
4 typedef unsigned long long int ULong;
5 typedef unsigned int UInt;
7 ULong arg64, res64;
9 extern void foo64 ( void );
10 asm("\n"
11 ".text\n"
12 "foo64:\n"
13 "\tpushq %rcx\n"
15 "\tmovq $0, %rax\n"
16 "\tmovq arg64, %rcx\n"
18 "Lagain64:\n"
19 "\taddq $177, %rax\n"
20 "\tdecq %rcx\n"
21 "\tjrcxz Lout64\n"
22 "\tjmp Lagain64\n"
24 "Lout64:\n"
25 "\tmovq %rax, res64\n"
27 "\tpopq %rcx\n"
28 "\tret\n"
29 ".previous\n"
33 UInt arg32, res32;
35 extern void foo32 ( void );
36 asm("\n"
37 ".text\n"
38 "foo32:\n"
39 "\tpushq %rcx\n"
41 "\tmovq $0, %rax\n"
42 "\tmovl arg32, %ecx\n"
44 "Lagain32:\n"
45 "\taddq $177, %rax\n"
46 "\tdecl %ecx\n"
47 "\tjecxz Lout32\n"
48 "\tjmp Lagain32\n"
50 "Lout32:\n"
51 "\tmovl %eax, res32\n"
53 "\tpopq %rcx\n"
54 "\tret\n"
55 ".previous\n"
60 int main ( void )
62 arg64 = 100;
63 res64 = 0;
64 foo64();
65 printf("%lld\n", res64);
67 arg32 = 1234;
68 res32 = 0;
69 foo32();
70 printf("%d\n", res32);
72 return 0;