summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCUDA/exceptions.cu
blob: 75586bc4a979f0b8bde552be2689f926b19c8e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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'}}
}
OpenPOWER on IntegriCloud