Clang Project

clang_source_code/test/CodeGen/pr34021.c
1// REQUIRES: x86-registered-target
2// RUN: %clang_cc1 -fms-extensions %s -triple=i686-unknown-unknown -emit-llvm -o - | FileCheck %s --check-prefix=X86
3// RUN: %clang_cc1 -fms-extensions %s -triple=x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s --check-prefix=X64
4
5typedef int v4si __attribute__ ((vector_size (16)));
6v4si rep() {
7// X86-LABEL: define <4 x i32> @rep
8// X86: %[[ALLOCA0:.*]] = alloca <4 x i32>, align 16
9// X86: %[[ALLOCA1:.*]] = alloca <4 x i32>, align 16
10// X86: %[[BITCAST:.*]] = bitcast <4 x i32>* %[[ALLOCA0]] to i128*
11// X86: %[[ASM:.*]] = call i64 asm sideeffect inteldialect "", "=A,~{dirflag},~{fpsr},~{flags}"()
12// X86: %[[ZEXT:.*]] = zext i64 %[[ASM]] to i128
13// X86: store i128 %[[ZEXT]], i128* %[[BITCAST]], align 16
14// X86: %[[LOAD:.*]] = load <4 x i32>, <4 x i32>* %[[ALLOCA1]], align 16
15// X86: ret <4 x i32> %[[LOAD]]
16//
17// X64-LABEL: define <4 x i32> @rep
18// X64: %[[ALLOCA:.*]] = alloca <4 x i32>, align 16
19// X64: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"()
20// X64: %[[LOAD:.*]] = load <4 x i32>, <4 x i32>* %[[ALLOCA]], align 16
21// X64: ret <4 x i32> %[[LOAD]]
22  v4si res;
23  __asm {}
24  return res;
25}
26