Skip to content

Commit 202de4a

Browse files
authored
Fix __builtin_vectorelements tests with REQUIRES (llvm#69582)
Small fix for failing tests after merge of llvm#69010. The tests need `REQUIRES` to ensure that the correct headers are available. I've also added a generic x86 build which does not need headers, so there is at least one run per test.
1 parent d2edff8 commit 202de4a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

clang/test/CodeGen/builtin_vectorelements.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +neon %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,NEON %s
2-
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +sve %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,SVE %s
3-
// RUN: %clang_cc1 -O1 -triple riscv64 -target-feature +v %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,RISCV %s
1+
// RUN: %clang_cc1 -O1 -triple x86_64 %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK %s
42

5-
// Note that this does not make sense to check for x86 SIMD types, because
6-
// __m128i, __m256i, and __m512i do not specify the element type. There are no
7-
// "logical" number of elements in them.
3+
// REQUIRES: target=aarch64-{{.*}}
4+
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +neon %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,NEON %s
5+
6+
// REQUIRES: target=aarch64-{{.*}}
7+
// RUN: %clang_cc1 -O1 -triple aarch64 -target-feature +sve %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,SVE %s
8+
9+
// REQUIRES: target=riscv64{{.*}}
10+
// RUN: %clang_cc1 -O1 -triple riscv64 -target-feature +v %s -emit-llvm -disable-llvm-passes -o - | FileCheck --check-prefixes=CHECK,RISCV %s
11+
12+
/// Note that this does not make sense to check for x86 SIMD types, because
13+
/// __m128i, __m256i, and __m512i do not specify the element type. There are no
14+
/// "logical" number of elements in them.
815

916
typedef int int1 __attribute__((vector_size(4)));
1017
typedef int int4 __attribute__((vector_size(16)));
@@ -56,7 +63,6 @@ int test_builtin_vectorelements_multiply_constant() {
5663
return __builtin_vectorelements(int16) * 2;
5764
}
5865

59-
6066
#if defined(__ARM_NEON)
6167
#include <arm_neon.h>
6268

clang/test/SemaCXX/builtin_vectorelements.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// RUN: %clang_cc1 -triple x86_64 -std=c++20 -fsyntax-only -verify -disable-llvm-passes %s
2+
3+
// REQUIRES: target=aarch64-{{.*}}
14
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -std=c++20 -fsyntax-only -verify -disable-llvm-passes %s
25

36
template <typename T>

0 commit comments

Comments
 (0)