1 // RUN: %llvmgcc %s -S -O3 -o - | llc -march=x86-64 -mtriple=x86_64-apple-darwin | FileCheck %s 2 // r9 used to be clobbered before its value was moved to r10. 7993104. 3 4 void foo(int x, int y) { 5 // CHECK: bar 6 // CHECK-NOT: {{, %r9$}} 7 // CHECK: movq %r9, 8 // CHECK: movq {{.*}}, %r9 9 // CHECK: bar 10 register int lr9 asm("r9") = x; 11 register int lr10 asm("r10") = y; 12 int foo; 13 asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10)); 14 foo = lr9; 15 lr9 = x; 16 lr10 = foo; 17 asm volatile("bar" : "=r"(lr9) : "r"(lr9), "r"(lr10)); 18 } 19