blob: 979d4edbf8926a321c3d784e193ffe4c9447ded2 [file] [log] [blame]
Eli Bendersky4bdc50e2015-04-15 22:27:06 +00001// Test that we can disable cross-target call checks in Sema with the
2// -fcuda-disable-target-call-checks flag. Without this flag we'd get a bunch
3// of errors here, since there are invalid cross-target calls present.
4
5// RUN: %clang_cc1 -fsyntax-only -verify %s -fcuda-disable-target-call-checks
6// RUN: %clang_cc1 -fsyntax-only -fcuda-is-device -verify %s -fcuda-disable-target-call-checks
7
8// expected-no-diagnostics
9
10#define __device__ __attribute__((device))
11#define __global__ __attribute__((global))
12#define __host__ __attribute__((host))
13
14__attribute__((host)) void h1();
15
16__attribute__((device)) void d1() {
17 h1();
18}
19
20__attribute__((host)) void h2() {
21 d1();
22}
23
24__attribute__((global)) void g1() {
25 h2();
26}