1 // RUN: not %clang_cc1 -fcxx-exceptions -fcuda-is-device -fsyntax-only \
2 // RUN:   -ferror-limit 2 2>&1 %s | FileCheck %s
3 
4 #include "Inputs/cuda.h"
5 
6 // CHECK: cannot use 'throw' in __host__ __device__ function
7 // CHECK: cannot use 'throw' in __host__ __device__ function
8 // CHECK-NOT: cannot use 'throw' in __host__ __device__ function
9 // CHECK: too many errors emitted, stopping now
10 
hasInvalid()11 inline __host__ __device__ void hasInvalid() {
12   throw NULL;
13 }
14 
use0()15 __global__ void use0() {
16   hasInvalid();
17   hasInvalid();
18   hasInvalid();
19   hasInvalid();
20 }
21