CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
63 lines
1.4 KiB
Plaintext
63 lines
1.4 KiB
Plaintext
// RUN: %clang_cc1 -fcxx-exceptions -fcuda-is-device -fsyntax-only -std=c++17 -verify %s
|
|
|
|
#include "Inputs/cuda.h"
|
|
|
|
// Error, instantiated on device.
|
|
inline __host__ __device__ void hasInvalid() {
|
|
throw NULL;
|
|
// expected-error@-1 {{cannot use 'throw' in __host__ __device__ function}}
|
|
}
|
|
|
|
inline __host__ __device__ void hasInvalid2() {
|
|
throw NULL;
|
|
// expected-error@-1 {{cannot use 'throw' in __host__ __device__ function}}
|
|
}
|
|
|
|
inline __host__ __device__ void hasInvalidDiscarded() {
|
|
// This is only used in the discarded statements below, so this should not diagnose.
|
|
throw NULL;
|
|
}
|
|
|
|
static __device__ void use0() {
|
|
hasInvalid(); // expected-note {{called by 'use0'}}
|
|
hasInvalid();
|
|
|
|
if constexpr (true) {
|
|
hasInvalid2(); // expected-note {{called by 'use0'}}
|
|
} else {
|
|
hasInvalidDiscarded();
|
|
}
|
|
|
|
if constexpr (false) {
|
|
hasInvalidDiscarded();
|
|
} else {
|
|
hasInvalid2();
|
|
}
|
|
|
|
if constexpr (false) {
|
|
hasInvalidDiscarded();
|
|
}
|
|
}
|
|
|
|
// Deferred diagnostics are emitted once per function, with all callers
|
|
// listed as notes.
|
|
static __device__ void use1() {
|
|
use0(); // expected-note 2{{which is called by 'use1'}}
|
|
use0();
|
|
}
|
|
|
|
static __device__ void use2() {
|
|
use1(); // expected-note 2{{which is called by 'use2'}}
|
|
use1();
|
|
}
|
|
|
|
static __device__ void use3() {
|
|
use2(); // expected-note 2{{which is called by 'use3'}}
|
|
use2();
|
|
}
|
|
|
|
__global__ void use4() {
|
|
use3(); // expected-note 2{{which is called by 'use4'}}
|
|
use3();
|
|
}
|