summaryrefslogtreecommitdiffstats
path: root/test cases/common/127 generated assembly/square-x86.S.in
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/common/127 generated assembly/square-x86.S.in')
-rw-r--r--test cases/common/127 generated assembly/square-x86.S.in34
1 files changed, 34 insertions, 0 deletions
diff --git a/test cases/common/127 generated assembly/square-x86.S.in b/test cases/common/127 generated assembly/square-x86.S.in
new file mode 100644
index 0000000..1a48fc4
--- /dev/null
+++ b/test cases/common/127 generated assembly/square-x86.S.in
@@ -0,0 +1,34 @@
+#include "symbol-underscore.h"
+
+#if defined(_MSC_VER) && !defined(__clang__)
+
+.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)
+/* Only supported with GAS */
+# if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
+.type square_unsigned,@function
+# endif
+
+SYMBOL_NAME(square_unsigned):
+ movl 4(%esp), %eax
+ imull %eax, %eax
+ retl
+
+#endif