1*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -fsyntax-only -fno-cuda-host-device-constexpr -verify %s 2*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -fsyntax-only -fno-cuda-host-device-constexpr -fcuda-is-device -verify %s 3*67e74705SXin Li 4*67e74705SXin Li #include "Inputs/cuda.h" 5*67e74705SXin Li 6*67e74705SXin Li // Check that, with -fno-cuda-host-device-constexpr, constexpr functions are 7*67e74705SXin Li // host-only, and __device__ constexpr functions are still device-only. 8*67e74705SXin Li f()9*67e74705SXin Liconstexpr int f() { return 0; } // expected-note {{not viable}} g()10*67e74705SXin Li__device__ constexpr int g() { return 0; } // expected-note {{not viable}} 11*67e74705SXin Li foo()12*67e74705SXin Livoid __device__ foo() { 13*67e74705SXin Li f(); // expected-error {{no matching function}} 14*67e74705SXin Li g(); 15*67e74705SXin Li } 16*67e74705SXin Li foo()17*67e74705SXin Livoid __host__ foo() { 18*67e74705SXin Li f(); 19*67e74705SXin Li g(); // expected-error {{no matching function}} 20*67e74705SXin Li } 21