Skip to content

Commit 2f620ee

Browse files
Merge pull request #124 from kateinoigakukun/yt/add-wasm-backend-validation-take2
Add validation check for WebAssembly compiler backend take 2
2 parents d3ceb9c + b046b37 commit 2f620ee

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ if llvm_bin_dir is None:
148148
lit_config.fatal("'--param llvm-bin-dir=PATH' is required")
149149
filecheck_path = os.path.join(llvm_bin_dir, 'FileCheck')
150150
readelf_path = os.path.join(llvm_bin_dir, 'llvm-readelf')
151+
readobj_path = os.path.join(llvm_bin_dir, 'llvm-readobj')
151152
lit_config.note("testing using 'FileCheck': %r" % (filecheck_path,))
152153
lit_config.note("testing using 'readelf': %r" % (readelf_path,))
154+
lit_config.note("testing using 'readobj': %r" % (readobj_path,))
153155

154156

155157
# Use the default Swift src layout if swiftpm is not provided as a
@@ -241,6 +243,7 @@ config.substitutions.append( ('%{swift}', swift_path) )
241243
config.substitutions.append( ('%{swiftc}', swiftc_path) )
242244
config.substitutions.append( ('%{FileCheck}', filecheck_path) )
243245
config.substitutions.append( ('%{readelf}', readelf_path) )
246+
config.substitutions.append( ('%{readobj}', readobj_path) )
244247
config.substitutions.append( ('%{sourcekit-lsp}', sourcekit_lsp_path) )
245248
config.substitutions.append( ('%{docc}', docc_path) )
246249

test-cross-compile/main.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
func foo() {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
RUN: rm -rf %t
2+
RUN: mkdir -p %t
3+
RUN: %{swiftc} -target wasm32-unknown-wasi -parse-stdlib -c %S/main.swift -o %t/main.o
4+
RUN: %{readobj} %t/main.o | %{FileCheck} %s
5+
6+
CHECK: Format: WASM
7+
CHECK: Arch: wasm32

0 commit comments

Comments
 (0)