Files
clang-p2996/llvm/test/CodeGen/WebAssembly/only-data.ll
Paulo Matos c67c9cfe3f [WebAssembly] Refactor and fix emission of external IR global decls
Reland of 00bf4755.

This patches fixes the visibility and linkage information of symbols
referring to IR globals.

Emission of external declarations is now done in the first execution
of emitConstantPool rather than in emitLinkage (and a few other
places). This is the point where we have already gathered information
about used symbols (by running the MC Lower PrePass) and not yet
started emitting any functions so that any declarations that need to
be emitted are done so at the top of the file before any functions.

This changes the order of a few directives in the final asm file which
required an update to a few tests.

Reviewed By: sbc100

Differential Revision: https://reviews.llvm.org/D118995
2022-02-04 22:01:46 +01:00

15 lines
503 B
LLVM

; RUN: llc < %s --mtriple=wasm32-unknown-unknown -asm-verbose=false -mattr=+reference-types | FileCheck %s
; Verify that types are output for external symbols, even in the absence of any defined functions
; CHECK: .type foo,@object
; CHECK-NEXT: .section .data.foo,"",@
; CHECK-NEXT: .globl foo
@foo = local_unnamed_addr global i32 (i32)* @bar, align 4
; CHECK-LABEL: foo:
; CHECK-NEXT: .int32 bar
; CHECK-NEXT: .size foo, 4
; CHECK: .functype bar (i32) -> (i32)
declare i32 @bar(i32 noundef)