diff options
Diffstat (limited to 'test/CodeGen/pr34021.c')
-rw-r--r-- | test/CodeGen/pr34021.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/pr34021.c b/test/CodeGen/pr34021.c new file mode 100644 index 000000000000..3c7a75a95aa9 --- /dev/null +++ b/test/CodeGen/pr34021.c @@ -0,0 +1,25 @@ +// REQUIRES: x86-registered-target +// RUN: %clang_cc1 -fms-extensions %s -triple=i686-unknown-unknown -emit-llvm -o - | FileCheck %s --check-prefix=X86 +// RUN: %clang_cc1 -fms-extensions %s -triple=x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s --check-prefix=X64 + +typedef int v4si __attribute__ ((vector_size (16))); +v4si rep() { +// X86-LABEL: define <4 x i32> @rep +// X86: %[[ALLOCA0:.*]] = alloca <4 x i32>, align 16 +// X86: %[[ALLOCA1:.*]] = alloca <4 x i32>, align 16 +// X86: %[[BITCAST:.*]] = bitcast <4 x i32>* %[[ALLOCA0]] to i128* +// X86: %[[ASM:.*]] = call i64 asm sideeffect inteldialect "", "=A,~{dirflag},~{fpsr},~{flags}"() +// X86: %[[ZEXT:.*]] = zext i64 %[[ASM]] to i128 +// X86: store i128 %[[ZEXT]], i128* %[[BITCAST]], align 16 +// X86: %[[LOAD:.*]] = load <4 x i32>, <4 x i32>* %[[ALLOCA1]], align 16 +// X86: ret <4 x i32> %[[LOAD]] +// +// X64-LABEL: define <4 x i32> @rep +// X64: %[[ALLOCA:.*]] = alloca <4 x i32>, align 16 +// X64: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"() +// X64: %[[LOAD:.*]] = load <4 x i32>, <4 x i32>* %[[ALLOCA]], align 16 +// X64: ret <4 x i32> %[[LOAD]] + v4si res; + __asm {} + return res; +} |