blob: 75586bc4a979f0b8bde552be2689f926b19c8e7e [file] [log] [blame]
// RUN: %clang_cc1 -fcxx-exceptions -fcuda-is-device -fsyntax-only -verify %s
// RUN: %clang_cc1 -fcxx-exceptions -fsyntax-only -verify %s
#include "Inputs/cuda.h"
void host() {
throw NULL;
try {} catch(void*) {}
}
__device__ void device() {
throw NULL;
// expected-error@-1 {{cannot use 'throw' in __device__ function 'device'}}
try {} catch(void*) {}
// expected-error@-1 {{cannot use 'try' in __device__ function 'device'}}
}
__global__ void kernel() {
throw NULL;
// expected-error@-1 {{cannot use 'throw' in __global__ function 'kernel'}}
try {} catch(void*) {}
// expected-error@-1 {{cannot use 'try' in __global__ function 'kernel'}}
}