aboutsummaryrefslogtreecommitdiffstats
path: root/test/Linker/ctors.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Linker/ctors.ll')
-rw-r--r--test/Linker/ctors.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Linker/ctors.ll b/test/Linker/ctors.ll
new file mode 100644
index 0000000..67bf456
--- /dev/null
+++ b/test/Linker/ctors.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-link %s %p/Inputs/ctors.ll -S -o - | \
+; RUN: FileCheck --check-prefix=ALL --check-prefix=CHECK1 %s
+; RUN: llvm-link %p/Inputs/ctors.ll %s -S -o - | \
+; RUN: FileCheck --check-prefix=ALL --check-prefix=CHECK2 %s
+
+@v = weak global i8 0
+; CHECK1: @v = weak global i8 0
+; CHECK2: @v = weak global i8 1
+
+@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* @v }]
+; ALL: @llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @f, i8* @v }]
+
+define weak void @f() {
+ ret void
+}