File: trivial-atexit.S

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (42 lines) | stat: -rw-r--r-- 1,306 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Test that the runtime correctly interposes atexit.
//
// REQUIRES: disabled
//   This test is disabled until a proper atexit interpose can be implemented:
//   the current one assumes that atexit is defined in the dylib that calls it,
//   which is not true in general. See
//   https://github.com/llvm/llvm-project/issues/74641
//
// RUN: %clang -c -o %t %s
// RUN: %llvm_jitlink %t

	.text
// OnExit destructor resets the test result override to zero.
	.section	.text._ZN6OnExitD2Ev,"axG",@progbits,_ZN6OnExitD2Ev,comdat
	.p2align	4, 0x90
	.type	_ZN6OnExitD2Ev,@function
_ZN6OnExitD2Ev:                         # @_ZN6OnExitD2Ev
	.cfi_startproc
	xorl	%edi, %edi
	jmp	llvm_jitlink_setTestResultOverride@PLT # TAILCALL
	.cfi_endproc

// main registers the atexit and sets the test result to one.
	.globl main
	.p2align	4, 0x90                         # -- Begin function main
	.type	main,@function
main:              # @main
	.cfi_startproc
# %bb.0:
	movq	_ZN6OnExitD2Ev@GOTPCREL(%rip), %rdi
	callq	atexit@PLT
	movl	$1, %edi
	callq	llvm_jitlink_setTestResultOverride@PLT
	xorl	%eax, %eax
	retq
.Lfunc_end1:
	.size	main, .Lfunc_end1-main
	.cfi_endproc
                                        # -- End function
	.type	_ZL6onExit,@object              # @_ZL6onExit
	.local	_ZL6onExit
	.comm	_ZL6onExit,1,1