xref: /llvm-project/clang/test/CodeGen/target-builtin-error-2.c (revision 90770c7c76574b72c5807c5af87bfc6bec7078d4)
115709991SEric Christopher // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o -
215709991SEric Christopher #define __MM_MALLOC_H
315709991SEric Christopher 
415709991SEric Christopher #include <x86intrin.h>
515709991SEric Christopher 
615709991SEric Christopher // Since we do code generation on a function level this needs to error out since
715709991SEric Christopher // the subtarget feature won't be available.
wombat(__m128i a)8*90770c7cSSimon Pilgrim __m128 wombat(__m128i a) {
915709991SEric Christopher   if (__builtin_cpu_supports("avx"))
10*90770c7cSSimon Pilgrim     return __builtin_ia32_vpermilvarps((__v4sf) {0.0f, 1.0f, 2.0f, 3.0f}, (__v4si)a); // expected-error {{'__builtin_ia32_vpermilvarps' needs target feature avx}}
1115709991SEric Christopher   else
12*90770c7cSSimon Pilgrim     return (__m128){0, 0};
1315709991SEric Christopher }
14