File: export-stdcall.s

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; 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 (32 lines) | stat: -rw-r--r-- 893 bytes parent folder | download | duplicates (26)
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
# REQUIRES: x86
# RUN: llvm-mc -triple i686-windows-msvc %s -o %t.obj -filetype=obj
# RUN: lld-link -safeseh:no %t.obj -out:%t.dll -dll -nodefaultlib -noentry -export:foo_std=bar_std -export:foo_fast=bar_fast
# RUN: llvm-nm %t.lib | FileCheck %s

# MSVC fudges the lookup of 'bar' to allow it to find the stdcall function
# _bar_std@8, and then exports _foo_std@8. Same for fastcall and other mangling
# schemes.

# CHECK: export-stdcall.s.tmp.dll:
# CHECK: 00000000 T @foo_fast@8
# CHECK: 00000000 T __imp_@foo_fast@8

# CHECK: export-stdcall.s.tmp.dll:
# CHECK: 00000000 T __imp__foo_std@8
# CHECK: 00000000 T _foo_std@8

	.text
	.def	 _bar_std@8; .scl	2; .type	32; .endef
	.globl	_bar_std@8
_bar_std@8:
	movl	8(%esp), %eax
	movl	4(%esp), %ecx
	leal	42(%ecx,%eax), %eax
	retl	$8

	.def	 @bar_fast@8; .scl	2; .type	32; .endef
	.globl	@bar_fast@8
@bar_fast@8:
	leal	42(%ecx,%eax), %eax
	retl