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
17 ldr x8, [x8, :got_lo12:x]
21 .size main, .Lfunc_end0-main
23 // static initializer sets the value of 'x' to zero.
25 .section .text.startup,"ax",@progbits
27 .type static_init,@function
31 ldr x8, [x8, :got_lo12:x]
35 .size static_init, .Lfunc_end1-static_init
45 .section .init_array,"aw",@init_array