43 lines · plain
1// Test that the runtime correctly interposes atexit.2//3// REQUIRES: disabled4// This test is disabled until a proper atexit interpose can be implemented:5// the current one assumes that atexit is defined in the dylib that calls it,6// which is not true in general. See7// https://github.com/llvm/llvm-project/issues/746418//9// RUN: %clang -c -o %t %s10// RUN: %llvm_jitlink %t11 12 .text13// OnExit destructor resets the test result override to zero.14 .globl on_exit15 .p2align 216 .type on_exit,@function17on_exit:18 19 move $a0, $zero20 b %plt(llvm_jitlink_setTestResultOverride)21.Lfunc_end0:22 .size on_exit, .Lfunc_end0-on_exit23 24// main registers the atexit and sets the test result to one.25 .globl main26 .p2align 227 .type main,@function28main:29 30 addi.d $sp, $sp, -1631 st.d $ra, $sp, 8 # 8-byte Folded Spill32 pcalau12i $a0, %pc_hi20(on_exit)33 addi.d $a0, $a0, %pc_lo12(on_exit)34 bl %plt(atexit)35 ori $a0, $zero, 136 bl %plt(llvm_jitlink_setTestResultOverride)37 move $a0, $zero38 ld.d $ra, $sp, 8 # 8-byte Folded Reload39 addi.d $sp, $sp, 1640 ret41.Lfunc_end1:42 .size main, .Lfunc_end1-main43