mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This patch adds parsing and extracting of the Swift reflection metadata data segments from within the WebAssembly DATA section and tests it using swift-reflection-dump. This is needed to allow LLDB to acces Swift reflection metadata when attached to WebAssembly processes. rdar://159217213
29 lines
739 B
Plaintext
29 lines
739 B
Plaintext
# RUN: %yaml2obj %S/Inputs/wasm.yaml -o %t.wasm
|
|
# RUN: %target-swift-reflection-dump --arch=wasi --no-objc-interop %t.wasm | %FileCheck %s
|
|
#
|
|
# CHECK: FIELDS
|
|
# CHECK: t:
|
|
# CHECK: ASSOCIATED TYPES
|
|
# CHECK: - : simple.P
|
|
# CHECK: typealias A = Builtin.Int32
|
|
# CHECK: Builtin.Int32
|
|
# CHECK: (builtin Builtin.Int32)
|
|
#
|
|
# simple.swift
|
|
# protocol P { associatedtype A }
|
|
# struct T {}
|
|
# struct S : P {
|
|
# typealias A = Builtin.Int32
|
|
# let t: T
|
|
# }
|
|
# sys.c
|
|
# void swift_addNewDSOImage() {}
|
|
#
|
|
# compiled for -target wasm32-unknown-wasip1
|
|
# obj2yaml simple.o -o simple.o.yaml
|
|
# (replace UNDEFINED symbol with a definition)
|
|
# obj2yaml simple.o.yaml -o simple-mod.o
|
|
# swiftc simple-mod.o sys.o -o simple.wasm
|
|
# yaml2obj simple.wasm -o simple-mod.o
|
|
#
|