| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv64gcv -mabi=lp64d -O1" } */ |
| 3 |
|
| 4 |
[[riscv::vector_cc]] void foo();// For C++11 and C23 |
| 5 |
|
| 6 |
[[riscv::vector_cc]] int var; /* { dg-warning "'vector_cc' attribute only applies to function types" } */ |
| 7 |
|
| 8 |
void __attribute__((riscv_vector_cc)) func(); |
| 9 |
void __attribute__((riscv_vector_cc(1))) func_invalid(); /* { dg-error "wrong number of arguments specified for 'riscv_vector_cc' attribute" } */ |
| 10 |
|
| 11 |
void test_no_attribute(int); |
| 12 |
void __attribute__((riscv_vector_cc)) test_no_attribute(int x) { } |
| 13 |
|
| 14 |
class test_cc { |
| 15 |
__attribute__((riscv_vector_cc)) void member_func(); |
| 16 |
}; |
| 17 |
|
| 18 |
void test_lambda() { |
| 19 |
__attribute__((riscv_vector_cc)) auto lambda = []() { /* { dg-warning "'riscv_vector_cc' attribute only applies to function types" } */ |
| 20 |
}; |
| 21 |
} |