Eli Bendersky | 4bdc50e | 2015-04-15 22:27:06 +0000 | [diff] [blame] | 1 | // 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 | } |