Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

107 lines
2.9 KiB
C++

// RUN: %clang++ -std=gnu++11 -O2 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --binary %t %dexter_lldb_args -v -- %s
// RUN: %clang++ -std=gnu++11 -O0 -g %s -o %t
// RUN: %dexter --fail-lt 1.0 -w \
// RUN: --binary %t %dexter_lldb_args -- %s
// REQUIRES: lldb
// Currently getting intermittent failures on darwin.
// UNSUPPORTED: system-windows, system-darwin
//// Check that the debugging experience with __attribute__((optnone)) at O2
//// matches O0. Test simple structs and methods.
long a_global_ptr[] = { 0xCAFEBABEL, 0xFEEDBEEFL };
namespace {
struct A {
int a;
float b;
enum B {
A_VALUE = 0x1,
B_VALUE = 0x2
};
struct some_data {
enum B other_b;
enum B other_other_b;
};
struct other_data {
union {
void *raw_ptr;
long *long_ptr;
float *float_ptr;
} a;
struct some_data b;
struct some_data c;
};
private:
struct other_data _data;
public:
struct other_data *getOtherData() { return &_data; }
__attribute__((always_inline,nodebug))
void setSomeData1(A::B value, A::B other_value) {
struct other_data *data = getOtherData();
data->b.other_b = value;
data->b.other_other_b = other_value;
}
__attribute__((always_inline))
void setSomeData2(A::B value, A::B other_value) {
struct other_data *data = getOtherData();
data->c.other_b = value;
data->c.other_other_b = other_value;
}
void setOtherData() {
setSomeData2(A_VALUE, B_VALUE);
getOtherData()->a.long_ptr = &a_global_ptr[0];
}
__attribute__((optnone))
A() {
__builtin_memset(this, 0xFF, sizeof(*this));
} //DexLabel('break_0')
// DexExpectWatchValue('a', '-1', on_line=ref('break_0'))
//// Check b is NaN by comparing it to itself.
// DexExpectWatchValue('this->b == this->b', 'false', on_line=ref('break_0'))
// DexExpectWatchValue('_data.a.raw_ptr == -1', 'true', on_line=ref('break_0'))
// DexExpectWatchValue('_data.a.float_ptr == -1', 'true', on_line=ref('break_0'))
// DexExpectWatchValue('_data.a.float_ptr == -1', 'true', on_line=ref('break_0'))
// DexExpectWatchValue('a_global_ptr[0]', 0xcafebabe, on_line=ref('break_0'))
// DexExpectWatchValue('a_global_ptr[1]', 0xfeedbeef, on_line=ref('break_0'))
__attribute__((optnone))
~A() {
*getOtherData()->a.long_ptr = 0xADDF00DL;
} //DexLabel('break_1')
// DexExpectWatchValue('_data.a.raw_ptr == a_global_ptr', 'true', on_line=ref('break_1'))
// DexExpectWatchValue('a_global_ptr[0]', 0xaddf00d, on_line=ref('break_1'))
__attribute__((optnone))
long getData() {
setSomeData1(B_VALUE, A_VALUE);
setOtherData();
return getOtherData()->a.long_ptr[1]; //DexLabel('break_2')
}
// DexExpectWatchValue('_data.b.other_b', 'B_VALUE', on_line=ref('break_2'))
// DexExpectWatchValue('_data.b.other_other_b', 'A_VALUE', on_line=ref('break_2'))
};
} // anonymous namespace
int main() {
int result = 0;
{
A a;
result = a.getData();
}
return result;
}