[flang] Fix length handling in character kind implicit conversion (#74586)
[llvm-project.git] / lldb / test / Shell / Register / Inputs / x86-gp-write.cpp
blob1dfbe31b99f750188154f574872114a3f7ac1734
1 #include <cinttypes>
2 #include <cstdint>
3 #include <cstdio>
5 int main() {
6 constexpr uint32_t fill = 0x0F0F0F0F;
8 uint32_t eax, ebx, ecx, edx, esi, edi;
9 // need to use 64-bit types due to bug in clang
10 // https://bugs.llvm.org/show_bug.cgi?id=41748
11 uint64_t esp, ebp;
13 asm volatile(
14 // save esp & ebp
15 "movd %%esp, %%mm0\n\t"
16 "movd %%ebp, %%mm1\n\t"
17 "\n\t"
18 "movl %8, %%eax\n\t"
19 "movl %8, %%ebx\n\t"
20 "movl %8, %%ecx\n\t"
21 "movl %8, %%edx\n\t"
22 "movl %8, %%esp\n\t"
23 "movl %8, %%ebp\n\t"
24 "movl %8, %%esi\n\t"
25 "movl %8, %%edi\n\t"
26 "\n\t"
27 "int3\n\t"
28 "\n\t"
29 // copy new values of esp & ebp
30 "movd %%esp, %4\n\t"
31 "movd %%ebp, %5\n\t"
32 // restore saved esp & ebp
33 "movd %%mm0, %%esp\n\t"
34 "movd %%mm1, %%ebp\n\t"
35 : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx), "=y"(esp), "=y"(ebp),
36 "=S"(esi), "=D"(edi)
37 : "i"(fill)
38 : "%mm0", "%mm1"
41 printf("eax = 0x%08" PRIx32 "\n", eax);
42 printf("ebx = 0x%08" PRIx32 "\n", ebx);
43 printf("ecx = 0x%08" PRIx32 "\n", ecx);
44 printf("edx = 0x%08" PRIx32 "\n", edx);
45 printf("esp = 0x%08" PRIx32 "\n", static_cast<uint32_t>(esp));
46 printf("ebp = 0x%08" PRIx32 "\n", static_cast<uint32_t>(ebp));
47 printf("esi = 0x%08" PRIx32 "\n", esi);
48 printf("edi = 0x%08" PRIx32 "\n", edi);
50 return 0;