# Constructor and destructor priorities. `constructor(N)` goes to
# .init_array.0000N, which the default linker script sorts by priority and
# places before plain .init_array entries (kept in link order). A raw
# .init_array.00150 pointer is sorted the same way. .fini_array runs in
# reverse order.
= "init_array/fini_array ordering with priorities across objects"
= ["cc -O2 -c a.c", "cc -O2 -c b.c", "cc -O2 -c main.c"]
= "cc"
= "-o out main.o a.o b.o"
= "./out"
= """
ctor 101 (b)
ctor 150 (raw section, a)
ctor 200 (a)
ctor default (main)
ctor default (a)
ctor default (b)
main
dtor default (b)
dtor default (a)
dtor 300 (b)
dtor 101 (a)
"""
= [".init_array", ".fini_array", "INIT_ARRAY", "FINI_ARRAY"]
= true