llvm/clang/test/SemaCUDA/deferred-diags-limit.cu
Yaxun (Sam) Liu 2c31aa2de1 Speed up deferred diagnostic emitter
Move function emitDeferredDiags from Sema to DeferredDiagsEmitter since it
is only used by DeferredDiagsEmitter.

Also skip visited functions to avoid exponential compile time.

Differential Revision: https://reviews.llvm.org/D77028
2020-04-06 13:07:43 -04:00

21 lines
540 B
Plaintext

// RUN: not %clang_cc1 -fcxx-exceptions -fcuda-is-device -fsyntax-only \
// RUN: -ferror-limit 2 2>&1 %s | FileCheck %s
#include "Inputs/cuda.h"
// CHECK: cannot use 'throw' in __host__ __device__ function
// CHECK: cannot use 'throw' in __host__ __device__ function
// CHECK-NOT: cannot use 'throw' in __host__ __device__ function
// CHECK: too many errors emitted, stopping now
inline __host__ __device__ void hasInvalid() {
throw NULL;
}
__global__ void use0() {
hasInvalid();
hasInvalid();
hasInvalid();
hasInvalid();
}