blob: 75586bc4a979f0b8bde552be2689f926b19c8e7e [file] [log] [blame]
Justin Lebar2a8db342016-09-28 22:45:54 +00001// RUN: %clang_cc1 -fcxx-exceptions -fcuda-is-device -fsyntax-only -verify %s
2// RUN: %clang_cc1 -fcxx-exceptions -fsyntax-only -verify %s
3
4#include "Inputs/cuda.h"
5
6void host() {
7 throw NULL;
8 try {} catch(void*) {}
9}
10__device__ void device() {
11 throw NULL;
12 // expected-error@-1 {{cannot use 'throw' in __device__ function 'device'}}
13 try {} catch(void*) {}
14 // expected-error@-1 {{cannot use 'try' in __device__ function 'device'}}
15}
16__global__ void kernel() {
17 throw NULL;
18 // expected-error@-1 {{cannot use 'throw' in __global__ function 'kernel'}}
19 try {} catch(void*) {}
20 // expected-error@-1 {{cannot use 'try' in __global__ function 'kernel'}}
21}