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
68 lines
2.4 KiB
C++
68 lines
2.4 KiB
C++
// RUN: %clang_cc1 -DSETNODEBUG=0 -emit-llvm -std=c++14 -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=YESINFO
|
|
// RUN: %clang_cc1 -DSETNODEBUG=1 -emit-llvm -std=c++14 -debug-info-kind=limited %s -o - | FileCheck %s --check-prefix=NOINFO
|
|
|
|
#if SETNODEBUG
|
|
#define NODEBUG __attribute__((nodebug))
|
|
#else
|
|
#define NODEBUG
|
|
#endif
|
|
|
|
// Const global variable. Use it so it gets emitted.
|
|
NODEBUG static const int const_global_int_def = 1;
|
|
void func1(int);
|
|
void func2() { func1(const_global_int_def); }
|
|
// YESINFO-DAG: !DIGlobalVariable(name: "const_global_int_def"
|
|
// NOINFO-NOT: !DIGlobalVariable(name: "const_global_int_def"
|
|
|
|
// Global variable with a more involved type.
|
|
// If the variable has no debug info, the type should not appear either.
|
|
struct S1 {
|
|
int a;
|
|
int b;
|
|
};
|
|
NODEBUG S1 global_struct = { 2, 3 };
|
|
// YESINFO-DAG: !DICompositeType({{.*}} name: "S1"
|
|
// NOINFO-NOT: !DICompositeType({{.*}} name: "S1"
|
|
// YESINFO-DAG: !DIGlobalVariable(name: "global_struct"
|
|
// NOINFO-NOT: !DIGlobalVariable(name: "global_struct"
|
|
|
|
// Static data members. Const member needs a use.
|
|
// Also the class as a whole needs a use, so that we produce debug info for
|
|
// the entire class (iterating over the members, demonstrably skipping those
|
|
// with 'nodebug').
|
|
struct S2 {
|
|
NODEBUG static int static_member;
|
|
NODEBUG static const int static_const_member = 4;
|
|
};
|
|
int S2::static_member = 5;
|
|
void func3() {
|
|
S2 junk;
|
|
func1(S2::static_const_member);
|
|
}
|
|
// YESINFO-DAG: !DIGlobalVariable(name: "static_member"
|
|
// NOINFO-NOT: !DIGlobalVariable(name: "static_member"
|
|
// YESINFO-DAG: !DIDerivedType({{.*}} name: "static_const_member"
|
|
// NOINFO-NOT: !DIDerivedType({{.*}} name: "static_const_member"
|
|
|
|
// Function-local static and auto variables.
|
|
void func4() {
|
|
NODEBUG static int static_local = 6;
|
|
NODEBUG int normal_local = 7;
|
|
}
|
|
// YESINFO-DAG: !DIGlobalVariable(name: "static_local"
|
|
// NOINFO-NOT: !DIGlobalVariable(name: "static_local"
|
|
// YESINFO-DAG: !DILocalVariable(name: "normal_local"
|
|
// NOINFO-NOT: !DILocalVariable(name: "normal_local"
|
|
|
|
template <typename T>
|
|
using y NODEBUG = int;
|
|
void func5() {
|
|
NODEBUG typedef int x;
|
|
x a;
|
|
y<int> b;
|
|
}
|
|
// YESINFO-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "x"
|
|
// NOINFO-NOT: !DIDerivedType(tag: DW_TAG_typedef, name: "x"
|
|
// YESINFO-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "y<int>"
|
|
// NOINFO-NOT: !DIDerivedType(tag: DW_TAG_typedef, name: "y<int>"
|