[ORC-RT] Test basic C++ static initialization support in the ORC runtime.

This tests that a simple C++ static initializer works as expected.

Compared to the architecture specific, assembly level regression tests for the
ORC runtime; this test is expected to catch cases where the compiler adopts
some new MachO feature that the ORC runtime does not yet support (e.g. a new
initializer section).
This commit is contained in:
Lang Hames
2024-11-21 18:14:10 +11:00
parent 476b208e01
commit 7c0786363e

View File

@@ -0,0 +1,17 @@
// RUN: %clangxx -c -o %t %s
// RUN: %llvm_jitlink %t
//
// REQUIRES: system-darwin && host-arch-compatible
static int x = 1;
class Init {
public:
Init() { x = 0; }
};
static Init I;
int main(int argc, char *argv[]) {
return x;
}