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

90 lines
1.9 KiB
C++

// Class Foo
#pragma implementation
// We don't use header files, since we only want to see, whether the
// compiler is installed properly.
//
#if __GNUG__ >= 2
typedef __SIZE_TYPE__ size_t;
#else
typedef unsigned int size_t;
#endif
extern "C" {
char *strncpy (char* dest, const char* src, size_t len);
int printf (const char*, ...);
};
#include "cdtest-foo.h"
int Foo::foos = 0;
void Foo::init_foo ()
{
printf ("BROKENLY calling Foo::init_foo from __init_start; size_of(Foo) = %ld\n", (long) sizeof(Foo));
foos = FOOLISH_NUMBER;
}
Foo::Foo ()
{
i = ++foos;
strncpy (message, "default-foo", len);
#ifdef WITH_ADDR
printf ("Constructing Foo(%d) \"default-foo\" at %08x\n", i, this);
#else
printf ("Constructing Foo(%d) \"default-foo\"\n", i);
#endif
}
Foo::Foo (const char* msg)
{
i = ++foos;
strncpy( message, msg, len);
#ifdef WITH_ADDR
printf ( "Constructing Foo(%d) \"%s\" at %08x\n", i, message, this);
#else
printf ( "Constructing Foo(%d) \"%s\"\n", i, message);
#endif
}
Foo::Foo (const Foo& foo)
{
i = ++foos;
#ifdef WITH_ADDR
printf ("Initializing Foo(%d) \"%s\" at %08x with Foo(%d) %08x\n",
i, foo.message, this, foo.i, &foo);
#else
printf ("Initializing Foo(%d) \"%s\" with Foo(%d)\n",i, foo.message, foo.i);
#endif
for ( int k = 0; k < FOO_MSG_LEN; k++) message[k] = foo.message[k];
}
Foo& Foo::operator= (const Foo& foo)
{
#ifdef WITH_ADDR
printf ("Copying Foo(%d) \"%s\" at %08x to Foo(%d) %08x\n",
foo.i, foo.message, &foo, i, this);
#else
printf ("Copying Foo(%d) \"%s\" to Foo(%d)\n", foo.i, foo.message, i);
#endif
for ( int k = 0; k < FOO_MSG_LEN; k++) message[k] = foo.message[k];
return *this;
}
Foo::~Foo ()
{
foos--;
#ifdef WITH_ADDR
printf ("Destructing Foo(%d) \"%s\" at %08x (remaining foos: %d)\n",
i, message, this, foos);
#else
printf ("Destructing Foo(%d) \"%s\" (remaining foos: %d)\n",
i, message, foos);
#endif
}