.import_global is used by the ELF-based target and not needed by the wasm
target.
llvm-svn: 319796
for (const auto &G : M.globals()) {
if (!G.hasInitializer() && G.hasExternalLinkage()) {
uint16_t Size = M.getDataLayout().getTypeAllocSize(G.getValueType());
- getTargetStreamer()->emitGlobalImport(G.getGlobalIdentifier());
+ if (TM.getTargetTriple().isOSBinFormatELF())
+ getTargetStreamer()->emitGlobalImport(G.getGlobalIdentifier());
OutStreamer->emitELFSize(getSymbol(&G),
MCConstantExpr::create(Size, OutContext));
}
target triple = "wasm32-unknown-unknown-wasm"
; CHECK: .globl foo
+; CHECK: .type foo,@function
; CHECK-LABEL: foo:
-define void @foo() {
- ret void
+; CHECK: .size foo,
+define i32* @foo() {
+ ret i32* @bar
}
-; Check import directives - must be at the end of the file
-; CHECK: .import_global bar{{$}}
-@bar = external global i32
+; CHECK: .type bar,@object
+; CHECK: .globl bar
+; CHECK: .size bar, 4
+@bar = global i32 2