1 // Test that basic COFF static initializers work. The main function in this
2 // test returns the expression a + b + c + 1. a is initialzed as -1 and c is
3 // initialized as -2 by static initializers. b is initialized as 2 by constant
4 // value. The test will succeeds only if static initializers are ran successfully.
6 // RUN: %clang -c -o %t %s
7 // RUN: %llvm_jitlink %t
15 .file "static-initializer.cpp"
20 .globl init # -- Begin function init
24 movl $4294967295, %eax # imm = 0xFFFFFFFF
31 .globl init2 # -- Begin function init2
35 movl $4294967294, %eax # imm = 0xFFFFFFFE
42 .p2align 4, 0x90 # -- Begin function ??__Ea@@YAXXZ
43 "??__Ea@@YAXXZ": # @"??__Ea@@YAXXZ"
44 .seh_proc "??__Ea@@YAXXZ"
59 .p2align 4, 0x90 # -- Begin function ??__Ec@@YAXXZ
60 "??__Ec@@YAXXZ": # @"??__Ec@@YAXXZ"
61 .seh_proc "??__Ec@@YAXXZ"
76 .globl main # -- Begin function main
91 callq *__imp_llvm_jitlink_setTestResultOverride(%rip)
97 .def _GLOBAL__sub_I_static_initializer.cpp;
101 .p2align 4, 0x90 # -- Begin function _GLOBAL__sub_I_static_initializer.cpp
102 _GLOBAL__sub_I_static_initializer.cpp: # @_GLOBAL__sub_I_static_initializer.cpp
103 .seh_proc _GLOBAL__sub_I_static_initializer.cpp
108 callq "??__Ea@@YAXXZ"
109 callq "??__Ec@@YAXXZ"
133 .section .CRT$XCU,"dr"
135 .quad _GLOBAL__sub_I_static_initializer.cpp