Debian Codegraph @

clang/test/PCH/riscv-rvv-vectors.c

raw
1 // REQUIRES: riscv-registered-target
2 // RUN: rm -rf %t
3 // RUN: split-file %s %t
4
5
6 // Test precompiled header
7 // RUN: %clang_cc1 -triple riscv64-linux-gnu -target-feature +v -emit-pch -o %t/test_pch.pch %t/test_pch.h
8 // RUN: %clang_cc1 -triple riscv64-linux-gnu -target-feature +v -include-pch %t/test_pch.pch \
9 // RUN: -fsyntax-only -verify %t/test_pch_src.c
10 //
11 // Test precompiled module(only available after C++20)
12 // RUN: %clang_cc1 -triple riscv64-linux-gnu -target-feature +v -std=c++20 -xc++-user-header -emit-header-unit -o %t/test_module1.pcm %t/test_module1.h
13 // RUN: %clang_cc1 -triple riscv64-linux-gnu -target-feature +v -std=c++20 -xc++-user-header -emit-header-unit -o %t/test_module2.pcm %t/test_module2.h
14 // RUN: %clang_cc1 -triple riscv64-linux-gnu -target-feature +v -std=c++20 -fmodule-file=%t/test_module1.pcm -fmodule-file=%t/test_module2.pcm \
15 // RUN: -fsyntax-only %t/test_module_src.cpp
16
17 //--- test_pch.h
18 // expected-no-diagnostics
19 #include <riscv_vector.h>
20
21 //--- test_pch_src.c
22 // expected-no-diagnostics
23 vuint64m4_t v_add(vuint64m4_t a, vuint64m4_t b, size_t vl) {
24 return __riscv_vadd_vv_u64m4(a, b, vl);
25 }
26
27 //--- test_module1.h
28 // expected-no-diagnostics
29 #include <riscv_vector.h>
30
31 //--- test_module2.h
32 // expected-no-diagnostics
33 // empty header
34
35 //--- test_module_src.cpp
36 // expected-no-diagnostics
37 import "test_module1.h";
38 import "test_module2.h";
39 vuint64m4_t v_add(vuint64m4_t a, vuint64m4_t b, size_t vl) {
40 return __riscv_vadd_vv_u64m4(a, b, vl);
41 }