aboutsummaryrefslogtreecommitdiff
path: root/test cases/common/118 llvm ir and assembly/square-x86_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/common/118 llvm ir and assembly/square-x86_64.S')
-rw-r--r--test cases/common/118 llvm ir and assembly/square-x86_64.S37
1 files changed, 37 insertions, 0 deletions
diff --git a/test cases/common/118 llvm ir and assembly/square-x86_64.S b/test cases/common/118 llvm ir and assembly/square-x86_64.S
new file mode 100644
index 0000000..5678d00
--- /dev/null
+++ b/test cases/common/118 llvm ir and assembly/square-x86_64.S
@@ -0,0 +1,37 @@
+#include "symbol-underscore.h"
+
+#ifdef _MSC_VER /* MSVC on Windows */
+
+PUBLIC SYMBOL_NAME(square_unsigned)
+_TEXT SEGMENT
+
+SYMBOL_NAME(square_unsigned) PROC
+ mov eax, ecx
+ imul eax, eax
+ ret
+SYMBOL_NAME(square_unsigned) ENDP
+
+_TEXT ENDS
+END
+
+#else
+
+.text
+.globl SYMBOL_NAME(square_unsigned)
+# ifdef __linux__
+.type square_unsigned, %function
+#endif
+
+# if defined(_WIN32) || defined(__CYGWIN__) /* msabi */
+SYMBOL_NAME(square_unsigned):
+ imull %ecx, %ecx
+ movl %ecx, %eax
+ retq
+# else /* sysvabi */
+SYMBOL_NAME(square_unsigned):
+ imull %edi, %edi
+ movl %edi, %eax
+ retq
+# endif
+
+#endif