[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Sema / ppc-mma-builtins.c
blob20d779557d28a9a217cb27691efaf1ef013a1a88
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 \
3 // RUN: -target-feature -mma -fsyntax-only %s -verify
5 void test1(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, unsigned char *resp) {
6 __vector_pair res;
7 __builtin_vsx_assemble_pair(&res, vc, vc);
10 void test2(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, unsigned char *resp) {
11 __builtin_vsx_disassemble_pair(resp, (__vector_pair*)vpp);
14 void test3(const __vector_pair *vpp, signed long offset, __vector_pair *vp2) {
15 __vector_pair vp = __builtin_vsx_lxvp(offset, vpp);
16 __builtin_vsx_stxvp(vp, offset, vp2);
19 void test4(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, unsigned char *resp) {
20 __vector_quad vq = *((__vector_quad *)vqp);
21 __vector_pair vp = *((__vector_pair *)vpp);
22 __builtin_mma_xxmtacc(&vq); // expected-error {{this builtin is only valid on POWER10 or later CPUs}}
23 *((__vector_quad *)resp) = vq;
26 void test5(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, unsigned char *resp) {
27 __vector_quad vq = *((__vector_quad *)vqp);
28 __vector_pair vp = *((__vector_pair *)vpp);
29 __builtin_mma_pmxvf64ger(&vq, vp, vc, 0, 0); // expected-error {{this builtin is only valid on POWER10 or later CPUs}}
30 *((__vector_quad *)resp) = vq;