about summary refs log tree commit diff stats
path: root/reproducers/issue-508.c
blob: e143183b6236b11605b85a800316f9d0e5defdb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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);
}