1 // Test that basic ELF static initializers work. The main function in this
2 // test returns the value of 'x', which is initially 1 in the data section,
3 // and reset to 0 if the _static_init function is run. If the static initializer
4 // does not run then main will return 1, causing the test to be treated as a
7 // RUN: %clang -c -o %t %s
8 // RUN: %llvm_jitlink %t
14 .type static_init,@function
18 addis 2, 12, .TOC.-.Lfunc_gep0@ha
19 addi 2, 2, .TOC.-.Lfunc_gep0@l
21 .localentry static_init, .Lfunc_lep0-.Lfunc_gep0
29 .size static_init, .Lfunc_end0-.Lfunc_begin0
37 addis 2, 12, .TOC.-.Lfunc_gep1@ha
38 addi 2, 2, .TOC.-.Lfunc_gep1@l
40 .localentry main, .Lfunc_lep1-.Lfunc_gep1
47 .size main, .Lfunc_end1-.Lfunc_begin1
57 .section .init_array.0,"aw",@init_array