1 // Test that the runtime correctly interposes ___cxa_atexit.
3 // RUN: %clang -c -o %t %s
4 // RUN: %llvm_jitlink %t
7 // OnExit destructor resets the test result override to zero.
8 .section .text._ZN6OnExitD2Ev,"axG",@progbits,_ZN6OnExitD2Ev,comdat
10 .type _ZN6OnExitD2Ev,@function
11 _ZN6OnExitD2Ev: # @_ZN6OnExitD2Ev
14 jmp llvm_jitlink_setTestResultOverride@PLT # TAILCALL
17 // main registers the atexit and sets the test result to one.
19 .p2align 4, 0x90 # -- Begin function main
24 movq _ZN6OnExitD2Ev@GOTPCREL(%rip), %rdi
25 leaq _ZL6onExit(%rip), %rsi
26 leaq __dso_handle(%rip), %rdx
27 callq __cxa_atexit@PLT
29 callq llvm_jitlink_setTestResultOverride@PLT
33 .size main, .Lfunc_end1-main
36 .type _ZL6onExit,@object # @_ZL6onExit