about summary refs log tree commit diff stats
path: root/reproducers/issue-508.c
diff options
context:
space:
mode:
Diffstat (limited to 'reproducers/issue-508.c')
-rw-r--r--reproducers/issue-508.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/reproducers/issue-508.c b/reproducers/issue-508.c
new file mode 100644
index 0000000..e143183
--- /dev/null
+++ b/reproducers/issue-508.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int main() {
+  int mem = 0x12345678;
+  register long rax asm("rax") = 0x1234567812345678;
+  register int edi asm("edi") = 0x77777777;
+  asm("cmpxchg %[edi],%[mem]"
+      : [ mem ] "+m"(mem), [ rax ] "+r"(rax)
+      : [ edi ] "r"(edi));
+  long rax2 = rax;
+  printf("rax2 = %lx\n", rax2);
+}
+