llvm-project/llvm/test/CodeGen/WebAssembly
Derek Schuff 5859a9ed80 [WebAssembly] Emit type signatures for declared functions
Under emscripten, C code can take the address of a function implemented
in Javascript (which is exposed via an import in wasm). Because imports
do not have linear memory address in wasm, we need to generate a thunk
to be the target of the indirect call; it call the import directly.

To make this possible, LLVM needs to emit the type signatures for these
functions, because they may not be called directly or referred to other
than where the address is taken.

This uses s new .s directive (.functype) which specifies the signature.

Differential Revision: http://reviews.llvm.org/D20891

Re-apply r271599 but instead of bailing with an error when a declared
function has multiple returns, replace it with a pointer argument. Also
add the test case I forgot to 'git add' last time around.

llvm-svn: 271703
2016-06-03 18:34:36 +00:00
..
address-offsets.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
byval.ll [WebAssembly] Put __stack_pointer in the offset field of loads and stores. 2016-05-24 23:47:41 +00:00
call.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
cfg-stackify.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
comparisons_f32.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
comparisons_f64.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
comparisons_i32.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
comparisons_i64.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
conv.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
copysign-casts.ll [WebAssembly] Add -m:e to the target triple. 2016-01-07 03:19:23 +00:00
cpus.ll [WebAssembly] Tighten up some regexes in some tests. 2016-01-20 05:55:09 +00:00
dead-vreg.ll [WebAssembly] Rematerialize constants rather than hold them live in registers. 2016-01-19 16:59:23 +00:00
divrem-constant.ll [WebAssembly] Don't expand divisions by constants. 2016-05-18 14:29:42 +00:00
f32.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
f64.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
fast-isel.ll [WebAssembly] Preliminary fast-isel support. 2016-05-10 17:39:48 +00:00
frem.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
func.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
global.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
globl.ll [WebAssembly] Add -m:e to the target triple. 2016-01-07 03:19:23 +00:00
i32-load-store-alignment.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
i32.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
i64-load-store-alignment.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
i64.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
i128.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
ident.ll [WebAssembly] Add -m:e to the target triple. 2016-01-07 03:19:23 +00:00
immediates.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
indirect-import.ll [WebAssembly] Emit type signatures for declared functions 2016-06-03 18:34:36 +00:00
inline-asm.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
irreducible-cfg.ll [WebAssembly] Account for implicit operands when computing operand indices. 2016-04-26 01:40:56 +00:00
legalize.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
lit.local.cfg
load-ext.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
load-store-i1.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
load.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
mem-intrinsics.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
memory-addr32.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
memory-addr64.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
non-executable-stack.ll [WebAssembly] Don't create a needless .note.GNU-stack section 2016-01-15 23:59:13 +00:00
offset-folding.ll [WebAssembly] Add tests for negative offsets with global variable addresses. 2016-01-25 15:19:39 +00:00
offset.ll [WebAssembly] Rename $discard to $drop in the assembly output. 2016-05-17 23:19:03 +00:00
phi.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
reg-stackify.ll [WebAssembly] Put __stack_pointer in the offset field of loads and stores. 2016-05-24 23:47:41 +00:00
return-int32.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
return-void.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
returned.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
select.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
signext-zeroext.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
store-results.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
store-trunc.ll [WebAssembly] Rename $discard to $drop in the assembly output. 2016-05-17 23:19:03 +00:00
store.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
switch.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
unreachable.ll [WebAssembly] Preliminary fast-isel support. 2016-05-10 17:39:48 +00:00
unused-argument.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
userstack.ll [WebAssembly] Put __stack_pointer in the offset field of loads and stores. 2016-05-24 23:47:41 +00:00
varargs.ll [WebAssembly] Optimize away return instructions using fallthroughs. 2016-05-21 00:21:56 +00:00
vtable.ll [WebAssembly] Add -m:e to the target triple. 2016-01-07 03:19:23 +00:00