33 lines · c
1// REQUIRES: riscv-registered-target2// RUN: not %clang_cc1 -triple riscv64 -target-feature +zifencei -target-feature +m -target-feature +a \3// RUN: -emit-llvm-only %s 2>&1 | FileCheck %s4 5#include <riscv_vector.h>6 7void test_builtin() {8// CHECK: error: '__builtin_rvv_vsetvli' needs target feature zve32x9 __riscv_vsetvl_e8m8(1);10}11 12void test_rvv_i32_type() {13// CHECK: error: RISC-V type 'vint32m1_t' (aka '__rvv_int32m1_t') requires the 'zve32x' extension14 vint32m1_t v;15}16 17void test_rvv_f32_type() {18// CHECK: error: RISC-V type 'vfloat32m1_t' (aka '__rvv_float32m1_t') requires the 'zve32f' extension19 vfloat32m1_t v;20}21 22void test_rvv_f64_type() {23// CHECK: error: RISC-V type 'vfloat64m1_t' (aka '__rvv_float64m1_t') requires the 'zve64d' extension24 vfloat64m1_t v;25}26 27// CHECK: error: duplicate 'arch=' in the 'target' attribute string;28__attribute__((target("arch=rv64gc;arch=rv64gc_zbb"))) void testMultiArchSelectLast() {}29// CHECK: error: duplicate 'cpu=' in the 'target' attribute string;30__attribute__((target("cpu=sifive-u74;cpu=sifive-u54"))) void testMultiCpuSelectLast() {}31// CHECK: error: duplicate 'tune=' in the 'target' attribute string;32__attribute__((target("tune=sifive-u74;tune=sifive-u54"))) void testMultiTuneSelectLast() {}33