[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / PowerPC / altivec-ct.c
blob6be6cec409fa17840b17129d1b99f3ec4e81bc6b
1 // RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc64le-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature +vsx | FileCheck %s -check-prefix=CHECK -check-prefix=VSX
2 // RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature -vsx | FileCheck %s
4 // REQUIRES: powerpc-registered-target
6 #include <altivec.h>
8 // CHECK-LABEL: test1
9 // CHECK: vcfsx
10 vector float test1(vector int x) {
11 return vec_ctf(x, 0);
14 // CHECK-LABEL: test2
15 // CHECK: vcfux
16 vector float test2(vector unsigned int x) {
17 return vec_ctf(x, 0);
20 #ifdef __VSX__
21 // VSX-LABEL: test3
22 vector float test3(vector signed long long x) {
23 return vec_ctf(x, 0);
26 // VSX-LABEL: test4
27 vector float test4(vector unsigned long long x) {
28 return vec_ctf(x, 0);
30 #endif
32 // CHECK-LABEL: test5
33 // CHECK: vcfsx
34 vector float test5(vector int x) {
35 return vec_vcfsx(x, 0);
38 // CHECK-LABEL: test6
39 // CHECK: vcfux
40 vector float test6(vector unsigned int x) {
41 return vec_vcfux(x, 0);
44 // CHECK-LABEL: test7
45 // CHECK: vctsxs
46 vector int test7(vector float x) {
47 return vec_cts(x, 0);
50 #ifdef __VSX__
51 // VSX-LABEL: test8
52 vector signed long long test8(vector double x) {
53 return vec_cts(x, 0);
56 #endif
58 // CHECK-LABEL: test9
59 // CHECK: vctsxs
60 vector int test9(vector float x) {
61 return vec_vctsxs(x, 0);
64 // CHECK-LABEL: test10
65 // CHECK: vctuxs
66 vector unsigned test10(vector float x) {
67 return vec_ctu(x, 0);
70 #ifdef __VSX__
71 // VSX-LABEL: test11
72 vector unsigned long long test11(vector double x) {
73 return vec_ctu(x, 0);
76 #endif
78 // CHECK-LABEL: test12
79 // CHECK: vctuxs
80 vector unsigned test12(vector float x) {
81 return vec_vctuxs(x, 0);