1 // Test that the runtime correctly interposes ___cxa_atexit.
3 // RUN: %clang -c -o %t %s
4 // RUN: %llvm_jitlink %t
7 // Destructor resets the test result override to zero.
10 .type on_exit,@function
14 b llvm_jitlink_setTestResultOverride
16 .size on_exit, .Lfunc_end0-on_exit
18 // main registers the atexit and sets the test result to one.
24 stp x29, x30, [sp, #-16]!
26 adrp x8, :got:__dso_handle
29 ldr x8, [x8, :got_lo12:__dso_handle]
31 ldr x0, [x0, :got_lo12:on_exit]
34 bl llvm_jitlink_setTestResultOverride
36 ldp x29, x30, [sp], #16
39 .size main, .Lfunc_end1-main