[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / PowerPC / builtins-ppc-fma.c
blob111302337954be345612d16af229ec4bf119e1ea
1 // RUN: %clang_cc1 -triple powerpc64le-gnu-linux \
2 // RUN: -target-feature +altivec -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck \
3 // RUN: %s
5 typedef __attribute__((vector_size(4 * sizeof(float)))) float vec_float;
6 typedef __attribute__((vector_size(2 * sizeof(double)))) double vec_double;
8 volatile vec_double vd;
9 volatile vec_float vf;
11 void test_fma(void) {
12 vf = __builtin_vsx_xvmaddasp(vf, vf, vf);
13 // CHECK: @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
15 vd = __builtin_vsx_xvmaddadp(vd, vd, vd);
16 // CHECK: @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
18 vf = __builtin_vsx_xvnmaddasp(vf, vf, vf);
19 // CHECK: [[RESULT:%[^ ]+]] = call <4 x float> @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
20 // CHECK: fneg <4 x float> [[RESULT]]
22 vd = __builtin_vsx_xvnmaddadp(vd, vd, vd);
23 // CHECK: [[RESULT:%[^ ]+]] = call <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})
24 // CHECK: fneg <2 x double> [[RESULT]]
26 vf = __builtin_vsx_xvmsubasp(vf, vf, vf);
27 // CHECK: [[RESULT:%[^ ]+]] = fneg <4 x float> %{{.*}}
28 // CHECK: @llvm.fma.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> [[RESULT]])
30 vd = __builtin_vsx_xvmsubadp(vd, vd, vd);
31 // CHECK: [[RESULT:%[^ ]+]] = fneg <2 x double> %{{.*}}
32 // CHECK: <2 x double> @llvm.fma.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> [[RESULT]])
34 vf = __builtin_vsx_xvnmsubasp(vf, vf, vf);
35 // CHECK: call <4 x float> @llvm.ppc.fnmsub.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})
37 vd = __builtin_vsx_xvnmsubadp(vd, vd, vd);
38 // CHECK: call <2 x double> @llvm.ppc.fnmsub.v2f64(<2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}})