37 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// Check the force_cuda_host_device pragma.4 5#pragma clang force_cuda_host_device begin6void f();7#pragma clang force_cuda_host_device begin8void g();9#pragma clang force_cuda_host_device end10void h();11#pragma clang force_cuda_host_device end12 13void i(); // expected-note {{not viable}}14 15void host() {16 f();17 g();18 h();19 i();20}21 22__attribute__((device)) void device() {23 f();24 g();25 h();26 i(); // expected-error {{no matching function}}27}28 29#pragma clang force_cuda_host_device foo30// expected-warning@-1 {{incorrect use of #pragma clang force_cuda_host_device begin|end}}31 32#pragma clang force_cuda_host_device33// expected-warning@-1 {{incorrect use of #pragma clang force_cuda_host_device begin|end}}34 35#pragma clang force_cuda_host_device begin foo36// expected-warning@-1 {{incorrect use of #pragma clang force_cuda_host_device begin|end}}37