[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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user