blob: c70d97d61e47b3eb0c0e8ed0711bbf27a6b5817c [file] [log] [blame]
Justin Lebarba122ab2016-03-30 23:30:21 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fno-cuda-host-device-constexpr -verify %s
2// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fno-cuda-host-device-constexpr -fcuda-is-device -verify %s
3
4#include "Inputs/cuda.h"
5
6// Check that, with -fno-cuda-host-device-constexpr, constexpr functions are
7// host-only, and __device__ constexpr functions are still device-only.
8
9constexpr int f() { return 0; } // expected-note {{not viable}}
10__device__ constexpr int g() { return 0; } // expected-note {{not viable}}
11
12void __device__ foo() {
13 f(); // expected-error {{no matching function}}
14 g();
15}
16
17void __host__ foo() {
18 f();
19 g(); // expected-error {{no matching function}}
20}