diff options
author | Dan Gohman <dan433584@gmail.com> | 2019-01-24 21:08:30 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2019-01-24 21:08:30 +0000 |
commit | b432369f6b333378a60efb090db649819743ca95 (patch) | |
tree | 123aa207ba7af38523bed3d04102f4a40b75a3e5 /clang/test/CodeGen/wasm-import-module.c | |
parent | c1eee1d659155b99fac63cbf72491c27106f0481 (diff) | |
download | bcm5719-llvm-b432369f6b333378a60efb090db649819743ca95.tar.gz bcm5719-llvm-b432369f6b333378a60efb090db649819743ca95.zip |
[WebAssembly] Add an import_module function attribute
This adds a C/C++ attribute which corresponds to the LLVM IR wasm-import-module
attribute. It allows code to specify an explicit import module.
Differential Revision: https://reviews.llvm.org/D57160
llvm-svn: 352106
Diffstat (limited to 'clang/test/CodeGen/wasm-import-module.c')
-rw-r--r-- | clang/test/CodeGen/wasm-import-module.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/wasm-import-module.c b/clang/test/CodeGen/wasm-import-module.c new file mode 100644 index 00000000000..866a3a45994 --- /dev/null +++ b/clang/test/CodeGen/wasm-import-module.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -triple wasm32-unknown-unknown-wasm -emit-llvm -o - %s | FileCheck %s + +void __attribute__((import_module("bar"))) foo(void); + +void call(void) { + foo(); +} + +// CHECK: declare void @foo() [[A:#[0-9]+]] + +// CHECK: attributes [[A]] = {{{.*}} "wasm-import-module"="bar" {{.*}}} |