File: trivial-cxa-atexit.S

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (39 lines) | stat: -rw-r--r-- 1,123 bytes parent folder | download | duplicates (46)
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
// Test that the runtime correctly interposes ___cxa_atexit.
//
// 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
	leaq	_ZL6onExit(%rip), %rsi
	leaq	__dso_handle(%rip), %rdx
	callq	__cxa_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
	.hidden	__dso_handle