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
91 lines
1.9 KiB
C++
91 lines
1.9 KiB
C++
|
|
#define BUFFER_SIZE 16
|
|
struct PointType {
|
|
int x;
|
|
int y;
|
|
int buffer[BUFFER_SIZE];
|
|
};
|
|
#include <cstdio>
|
|
#include <vector>
|
|
extern int g_global;
|
|
int g_global = 123;
|
|
static int s_global = 234;
|
|
int test_indexedVariables();
|
|
int test_return_variable();
|
|
int test_anonymous_types();
|
|
int test_anonymous_fields();
|
|
void test_unnamed_bitfields();
|
|
|
|
int main(int argc, char const *argv[]) {
|
|
static float s_local = 2.25;
|
|
PointType pt = {11, 22, {0}};
|
|
for (int i = 0; i < BUFFER_SIZE; ++i)
|
|
pt.buffer[i] = i;
|
|
const char *valid_str = "𐌶𐌰L𐌾𐍈 C𐍈𐌼𐌴𐍃";
|
|
const char *malformed_str = "lone trailing \x81\x82 bytes";
|
|
printf("print malformed utf8 %s %s\n", valid_str, malformed_str);
|
|
int x = s_global - g_global - pt.y; // breakpoint 1
|
|
{
|
|
int x = 42;
|
|
{
|
|
int x = 72;
|
|
s_global = x; // breakpoint 2
|
|
}
|
|
}
|
|
{
|
|
int return_result = test_return_variable();
|
|
}
|
|
test_anonymous_types();
|
|
test_anonymous_fields();
|
|
test_unnamed_bitfields();
|
|
return test_indexedVariables(); // breakpoint 3
|
|
}
|
|
|
|
int test_indexedVariables() {
|
|
int small_array[5] = {1, 2, 3, 4, 5};
|
|
int large_array[200];
|
|
std::vector<int> small_vector;
|
|
std::vector<int> large_vector;
|
|
small_vector.assign(5, 0);
|
|
large_vector.assign(200, 0);
|
|
return 0; // breakpoint 4
|
|
}
|
|
|
|
int test_return_variable() {
|
|
return 300; // breakpoint 5
|
|
}
|
|
|
|
int test_anonymous_types() {
|
|
struct {
|
|
char name[16];
|
|
int x, y;
|
|
} my_var = {"hello world!", 42, 7};
|
|
return my_var.x + my_var.y; // breakpoint 6
|
|
}
|
|
|
|
struct MySock {
|
|
union {
|
|
unsigned char ipv4[4];
|
|
unsigned char ipv6[6];
|
|
};
|
|
};
|
|
|
|
int test_anonymous_fields() {
|
|
MySock home = {{{0}}};
|
|
home.ipv4[0] = 127;
|
|
home.ipv4[1] = 0;
|
|
home.ipv4[2] = 0;
|
|
home.ipv4[1] = 1;
|
|
return 1; // breakpoint 7
|
|
}
|
|
|
|
void test_unnamed_bitfields() {
|
|
struct example {
|
|
unsigned int lo : 4;
|
|
unsigned int : 0;
|
|
unsigned int hi : 4;
|
|
};
|
|
example e = {0xA, 0xB};
|
|
printf("lo: %u, hi: %u\n", e.lo, e.hi); // breakpoint 8
|
|
}
|