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