llvm-project
36 строк · 891.0 Байт
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// Check the force_cuda_host_device pragma.
4
5#pragma clang force_cuda_host_device begin
6void f();
7#pragma clang force_cuda_host_device begin
8void g();
9#pragma clang force_cuda_host_device end
10void h();
11#pragma clang force_cuda_host_device end
12
13void i(); // expected-note {{not viable}}
14
15void host() {
16f();
17g();
18h();
19i();
20}
21
22__attribute__((device)) void device() {
23f();
24g();
25h();
26i(); // expected-error {{no matching function}}
27}
28
29#pragma clang force_cuda_host_device foo
30// expected-warning@-1 {{incorrect use of #pragma clang force_cuda_host_device begin|end}}
31
32#pragma clang force_cuda_host_device
33// expected-warning@-1 {{incorrect use of #pragma clang force_cuda_host_device begin|end}}
34
35#pragma clang force_cuda_host_device begin foo
36// expected-warning@-1 {{incorrect use of #pragma clang force_cuda_host_device begin|end}}
37