1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
3 unsigned long long foo(unsigned long long addr
, unsigned long long a0
,
4 unsigned long long a1
, unsigned long long a2
,
5 unsigned long long a3
, unsigned long long a4
,
6 unsigned long long a5
) {
7 register unsigned long long result
asm("rax");
8 register unsigned long long b0
asm("rdi");
9 register unsigned long long b1
asm("rsi");
10 register unsigned long long b2
asm("rdx");
11 register unsigned long long b3
asm("rcx");
12 register unsigned long long b4
asm("r8");
13 register unsigned long long b5
asm("r9");
22 asm("call *%1" : "=r" (result
)
23 : "r"(addr
), "r" (b0
), "r" (b1
), "r" (b2
), "r" (b3
), "r" (b4
), "r" (b5
));
27 // CHECK: call i64 asm "call *$1", "={rax},r,{rdi},{rsi},{rdx},{rcx},{r8},{r9},~{dirflag},~{fpsr},~{flags}"
29 unsigned long long foo2(unsigned long long addr
, double a0
,
32 double a5
, double a6
, double a7
) {
33 register double b0
asm("xmm0");
34 register double b1
asm("xmm1");
35 register double b2
asm("xmm2");
36 register double b3
asm("xmm3");
37 register double b4
asm("xmm4");
38 register double b5
asm("xmm5");
39 register double b6
asm("xmm6");
40 register double b7
asm("xmm7");
42 register unsigned long long result
asm("rax");
53 asm("call *%1" : "=r" (result
)
54 : "r"(addr
), "x" (b0
), "x" (b1
), "x" (b2
), "x" (b3
), "x" (b4
), "x" (b5
), "x" (b6
),
59 // CHECK: call i64 asm "call *$1", "={rax},r,{xmm0},{xmm1},{xmm2},{xmm3},{xmm4},{xmm5},{xmm6},{xmm7},~{dirflag},~{fpsr},~{flags}
61 int randomvar
asm("randomvar");
63 asm("vartest %0" : : "r"(randomvar
));
65 // CHECK: call void asm sideeffect "vartest $0", "r,~{dirflag},~{fpsr},~{flags}"