Skip to content

Fix __builtin_vectorelements tests with REQUIRES #69582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions clang/test/CodeGen/builtin_vectorelements.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +neon %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,NEON %s
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +sve %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,SVE %s
// RUN: %clang_cc1 -O1 -triple riscv64 -target-feature +v %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,RISCV %s
// RUN: %clang_cc1 -O1 -triple x86_64 %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK %s

// Note that this does not make sense to check for x86 SIMD types, because
// __m128i, __m256i, and __m512i do not specify the element type. There are no
// "logical" number of elements in them.
// REQUIRES: target=aarch64-{{.*}}
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +neon %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,NEON %s

// REQUIRES: target=aarch64-{{.*}}
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +sve %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,SVE %s

// REQUIRES: target=riscv64{{.*}}
// RUN: %clang_cc1 -O1 -triple riscv64 -target-feature +v %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,RISCV %s

/// Note that this does not make sense to check for x86 SIMD types, because
/// __m128i, __m256i, and __m512i do not specify the element type. There are no
/// "logical" number of elements in them.

typedef int int1 __attribute__((vector_size(4)));
typedef int int4 __attribute__((vector_size(16)));
Expand Down Expand Up @@ -56,7 +63,6 @@ int test_builtin_vectorelements_multiply_constant() {
return __builtin_vectorelements(int16) * 2;
}


#if defined(__ARM_NEON)
#include <arm_neon.h>

Expand Down
3 changes: 3 additions & 0 deletions clang/test/SemaCXX/builtin_vectorelements.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// RUN: %clang_cc1 -triple x86_64 -std=c++20 -fsyntax-only -verify -disable-llvm-passes %s

// REQUIRES: target=aarch64-{{.*}}
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -std=c++20 -fsyntax-only -verify -disable-llvm-passes %s

template <typename T>
Expand Down