summaryrefslogtreecommitdiff
path: root/test cases/common/126 llvm ir and assembly/square-x86.S
blob: 7d1202a764134286bfa68a7727192c8d090806ba (plain)
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
#include "symbol-underscore.h"

/* This sadly doesn't test the symbol underscore stuff. I can't figure out how
 * to not use an automatic stdcall mechanism and do everything manually. */
#ifdef _MSC_VER

.386
.MODEL FLAT, C

PUBLIC square_unsigned
_TEXT   SEGMENT

square_unsigned PROC var1:DWORD
        mov     eax, var1
	imul	eax, eax
	ret
square_unsigned ENDP

_TEXT   ENDS
END

#else

.text
.globl SYMBOL_NAME(square_unsigned)
# ifdef __linux__
.type square_unsigned, %function
#endif

SYMBOL_NAME(square_unsigned):
	movl	4(%esp), %eax
	imull	%eax, %eax
	retl

#endif