// RUN: %llvmgcc %s -c -O3 -m64 -emit-llvm -o - | llc -march=x86-64 -mtriple=x86_64-apple-darwin | FileCheck %s
// XFAIL: *
// XTARGET: x86,i386,i686
// r9 used to be clobbered before its value was moved to r10.  7993104.

void foo(int x, int y) {
// CHECK: bar
// CHECK: movq  %r9, %r10
// CHECK: movq  %rdi, %r9
// CHECK: bar
  register int lr9 asm("r9") = x;
  register int lr10 asm("r10") = y;
  int foo;
  asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10));
  foo = lr9;
  lr9 = x;
  lr10 = foo;
  asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10));
}
// RUN: %llvmgcc %s -c -O3 -m64 -emit-llvm -o - | llc -march=x86-64 -mtriple=x86_64-apple-darwin | FileCheck %s
// r9 used to be clobbered before its value was moved to r10.  7993104.

void foo(int x, int y) {
// CHECK: bar
// CHECK: movq  %r9, %r10
// CHECK: movq  %rdi, %r9
// CHECK: bar
  register int lr9 asm("r9") = x;
  register int lr10 asm("r10") = y;
  int foo;
  asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10));
  foo = lr9;
  lr9 = x;
  lr10 = foo;
  asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10));
}
Test passed on ppc, to my surprise; if it worked there it may work everywhere...
Test passed on ppc, to my surprise; if it worked
there it may work everywhere...



git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@104053 91177308-0d34-0410-b5e6-96231b3b80d8
