aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/118 llvm ir and assembly/square-x86.S
diff options
context:
space:
mode:
Diffstat (limited to 'meson/test cases/common/118 llvm ir and assembly/square-x86.S')
-rw-r--r--meson/test cases/common/118 llvm ir and assembly/square-x86.S36
1 files changed, 36 insertions, 0 deletions
diff --git a/meson/test cases/common/118 llvm ir and assembly/square-x86.S b/meson/test cases/common/118 llvm ir and assembly/square-x86.S
new file mode 100644
index 000000000..18284c1a6
--- /dev/null
+++ b/meson/test cases/common/118 llvm ir and assembly/square-x86.S
@@ -0,0 +1,36 @@
+#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