Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / X86 / avx512-error.c
blob133e7d01ea33cf6619990a7ee9a27947d8b0c033
1 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +avx512bw -target-feature -evex512 -emit-llvm -o /dev/null -verify=noevex -DFEATURE_TEST=1
2 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +avx512bw -target-feature -evex512 -emit-llvm -o /dev/null -verify=noevex -DFEATURE_TEST=2
3 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +avx512bw -emit-llvm -o /dev/null -verify -DFEATURE_TEST=3
4 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +avx10.1-256 -emit-llvm -o /dev/null -verify=noevex -DFEATURE_TEST=1
5 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +avx10.1-256 -emit-llvm -o /dev/null -verify=noevex -DFEATURE_TEST=2
6 // RUN: %clang_cc1 %s -ffreestanding -triple=x86_64-unknown-unknown -target-feature +avx10.1-512 -emit-llvm -o /dev/null -verify -DFEATURE_TEST=3
8 #include <immintrin.h>
10 #if FEATURE_TEST & 3
11 // expected-no-diagnostics
12 #endif
14 #if FEATURE_TEST & 1
15 __attribute__((target("avx512bw,evex512")))
16 __m512d zmm_verify_ok(__m512d a) {
17 // No error emitted if we have "evex512" feature.
18 return __builtin_ia32_sqrtpd512(a, _MM_FROUND_CUR_DIRECTION);
21 __m512d zmm_error(__m512d a) {
22 // CHECK-LABEL: @test_mm512_sqrt_pd
23 return __builtin_ia32_sqrtpd512(a, _MM_FROUND_CUR_DIRECTION); // noevex-error {{'__builtin_ia32_sqrtpd512' needs target feature avx512f,evex512}}
25 #endif
27 #if FEATURE_TEST & 2
28 __attribute__((target("avx512bw,evex512")))
29 __mmask64 k64_verify_ok(__mmask64 a) {
30 // No error emitted if we have "evex512" feature.
31 return _knot_mask64(a);
34 __mmask64 test_knot_mask64(__mmask64 a) {
35 return _knot_mask64(a); // noevex-error {{always_inline function '_knot_mask64' requires target feature 'evex512', but would be inlined into function 'test_knot_mask64' that is compiled without support for 'evex512'}}
37 #endif