From e5da3e6e5671728007b720bd3afdef3332351358 Mon Sep 17 00:00:00 2001 From: Anton Yartsev Date: Sat, 19 Mar 2011 07:53:43 +0000 Subject: [PATCH] makes vec_step operator work when AltiVec support is enabled git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127949 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/TokenKinds.def | 2 +- test/SemaCXX/altivec.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 6fa4bf9304..25b8cd315f 100644 --- a/include/clang/Basic/TokenKinds.def +++ b/include/clang/Basic/TokenKinds.def @@ -349,7 +349,7 @@ KEYWORD(__forceinline , KEYALL) // OpenCL-specific keywords KEYWORD(__kernel , KEYOPENCL) ALIAS("kernel", __kernel , KEYOPENCL) -KEYWORD(vec_step , KEYOPENCL) +KEYWORD(vec_step , KEYOPENCL|KEYALTIVEC) KEYWORD(__private , KEYOPENCL) KEYWORD(__global , KEYOPENCL) KEYWORD(__local , KEYOPENCL) diff --git a/test/SemaCXX/altivec.cpp b/test/SemaCXX/altivec.cpp index 921bb73f9e..504eb1b336 100644 --- a/test/SemaCXX/altivec.cpp +++ b/test/SemaCXX/altivec.cpp @@ -2,6 +2,36 @@ typedef int V4i __attribute__((vector_size(16))); +void test_vec_step(vector short arg1) { + vector bool char vbc; + vector signed char vsc; + vector unsigned char vuc; + vector bool short vbs; + vector short vs; + vector unsigned short vus; + vector pixel vp; + vector bool int vbi; + vector int vi; + vector unsigned int vui; + vector float vf; + + vector int *pvi; + + int res1[vec_step(arg1) == 8 ? 1 : -1]; + int res2[vec_step(vbc) == 16 ? 1 : -1]; + int res3[vec_step(vsc) == 16 ? 1 : -1]; + int res4[vec_step(vuc) == 16 ? 1 : -1]; + int res5[vec_step(vbs) == 8 ? 1 : -1]; + int res6[vec_step(vs) == 8 ? 1 : -1]; + int res7[vec_step(vus) == 8 ? 1 : -1]; + int res8[vec_step(vp) == 8 ? 1 : -1]; + int res9[vec_step(vbi) == 4 ? 1 : -1]; + int res10[vec_step(vi) == 4 ? 1 : -1]; + int res11[vec_step(vui) == 4 ? 1 : -1]; + int res12[vec_step(vf) == 4 ? 1 : -1]; + int res13[vec_step(*pvi) == 4 ? 1 : -1]; +} + void f(V4i a) { } -- 2.40.0