summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/WebAssembly
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2018-11-02 22:04:33 +0000
committerWouter van Oortmerssen <aardappel@gmail.com>2018-11-02 22:04:33 +0000
commitde28b5d17fba2af6453fa04431a68c4f89cc1906 (patch)
treecb523c26ff963f03a6fc24476b5281d1802f2473 /llvm/test/MC/WebAssembly
parent53793e4d8e25aefb5c31ce3266afadf220e2d040 (diff)
downloadbcm5719-llvm-de28b5d17fba2af6453fa04431a68c4f89cc1906.tar.gz
bcm5719-llvm-de28b5d17fba2af6453fa04431a68c4f89cc1906.zip
[WebAssembly] Parsing missing directives to produce valid .o
Summary: The assembler was able to assemble and then dump back to .s, but was failing to parse certain directives necessary for valid .o output: - .type directives are now recognized to distinguish function symbols and others. - .size is now parsed to provide function size. - .globaltype (introduced in https://reviews.llvm.org/D54012) is now recognized to ensure symbols like __stack_pointer have a proper type set for both .s and .o output. Also added tests for the above. Reviewers: sbc100, dschuff Subscribers: jgravelle-google, aheejin, dexonsmith, kristina, llvm-commits, sunfish Differential Revision: https://reviews.llvm.org/D53842 llvm-svn: 346047
Diffstat (limited to 'llvm/test/MC/WebAssembly')
-rw-r--r--llvm/test/MC/WebAssembly/basic-assembly.s8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/test/MC/WebAssembly/basic-assembly.s b/llvm/test/MC/WebAssembly/basic-assembly.s
index cfffda57bcc..c2b316c9243 100644
--- a/llvm/test/MC/WebAssembly/basic-assembly.s
+++ b/llvm/test/MC/WebAssembly/basic-assembly.s
@@ -1,4 +1,6 @@
# RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+simd128,+nontrapping-fptoint,+exception-handling < %s | FileCheck %s
+# this one is just here to see if it converts to .o without errors, but doesn't check any output:
+# RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj -mattr=+simd128,+nontrapping-fptoint,+exception-handling < %s
.text
.type test0,@function
@@ -56,7 +58,9 @@ test0:
#i32.trunc_s:sat/f32
get_global __stack_pointer@GLOBAL
end_function
-
+.Lfunc_end0:
+ .size test0, .Lfunc_end0-test0
+ .globaltype __stack_pointer, i32
# CHECK: .text
# CHECK-LABEL: test0:
@@ -104,3 +108,5 @@ test0:
# CHECK-NEXT: end_try
# CHECK-NEXT: get_global __stack_pointer@GLOBAL
# CHECK-NEXT: end_function
+
+# CHECK: .globaltype __stack_pointer, i32
OpenPOWER on IntegriCloud