Skip to content

Commit 7c07863

Browse files
committed
[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).
1 parent 476b208 commit 7c07863

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %clangxx -c -o %t %s
2+
// RUN: %llvm_jitlink %t
3+
//
4+
// REQUIRES: system-darwin && host-arch-compatible
5+
6+
static int x = 1;
7+
8+
class Init {
9+
public:
10+
Init() { x = 0; }
11+
};
12+
13+
static Init I;
14+
15+
int main(int argc, char *argv[]) {
16+
return x;
17+
}

0 commit comments

Comments
 (0)