1 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s
7 // CHECK: [[REGCALLRESULT:%[a-zA-Z0-9\.]+]] = call ptr @foo()
8 // CHECK: call void asm "foobar", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr elementtype(i32) [[REGCALLRESULT]], ptr elementtype(i32) [[REGCALLRESULT]])
9 asm ("foobar" : "+m"(*foo()));
14 // CHECK: [[REGCALLRESULT:%[a-zA-Z0-9\.]+]] = call ptr @foo()
15 // CHECK: load i32, ptr [[REGCALLRESULT]]
16 // CHECK: call i32 asm
17 // CHECK: store i32 {{%[a-zA-Z0-9\.]+}}, ptr [[REGCALLRESULT]]
18 asm ("foobar" : "+r"(*foo()));
23 void test3(int *vout
, int vin
)
25 // CHECK: call void asm "opr $0,$1", "=*r|m|r,r|m|r,~{edi},~{dirflag},~{fpsr},~{flags}"
26 asm ("opr %[vout],%[vin]"
27 : [vout
] "=r,=m,=r" (*vout
)
32 // PR8959 - This should implicitly truncate the immediate to a byte.
34 int test4(volatile int *addr
) {
36 // CHECK: call i8 asm "frob $0", "=r,0{{.*}}"(i8 -1)
37 __asm__ ("frob %0" : "=r"(oldval
) : "0"(0xff));
41 // This should have both inputs be of type <1 x i64>.
43 typedef long long __m64
__attribute__((__vector_size__(8)));
44 __m64
test5(__m64 __A
, __m64 __B
) {
45 // CHECK: call <1 x i64> asm "pmulhuw $1, $0\0A\09", "=y,y,0,~{dirflag},~{fpsr},~{flags}"(<1 x i64> %{{.*}}, <1 x i64> %{{.*}})
46 asm ("pmulhuw %1, %0\n\t" : "+y" (__A
) : "y" (__B
));
52 typedef unsigned char __attribute__((vector_size(8))) _m64u8
;
53 _m64u8
__attribute__((aligned(16))) Mu8_0
, __attribute__((aligned(16))) Mu8_1
;
54 // CHECK: call <8 x i8> asm "nop", "=y,0,~{dirflag},~{fpsr},~{flags}"(<8 x i8> %0)
55 asm ("nop" : "=y"(Mu8_1
) : "0"(Mu8_0
));