Skip to content

Commit 64a8bf8

Browse files
committed
test: simpler sed expression in dependencies-random.swift
1 parent 09e54a1 commit 64a8bf8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/embedded/dependencies-random.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -parse-as-library -enable-experimental-feature Embedded -enable-experimental-feature Extern %s -c -o %t/a.o
33

4-
// RUN: grep DEP\: %s | sed 's#// DEP\: ##' | sort > %t/allowed-dependencies.txt
4+
// RUN: if [[ %target-os =~ "wasi" ]]; then pattern="DEP\:\|DEP-WASM\:"; else pattern="DEP\:"; fi; grep "$pattern" %s | sed "s#// .*\: ##" | sort > %t/allowed-dependencies.txt
55

66
// Linux/ELF and Wasm don't use the "_" prefix in symbol mangling.
77
// RUN: if [ %target-os == "linux-gnu" ] || [[ %target-os =~ "wasi" ]]; then sed -E -i -e 's/^_(.*)$/\1/' %t/allowed-dependencies.txt; fi
88

9-
// Wasm has additional dependencies
10-
// RUN: if [[ %target-os =~ "wasi" ]]; then sed -i '' -e '3 i\'$'\n''__stack_pointer' -e '1 i\'$'\n''__indirect_function_table' -e '1 i\'$'\n''__memory_base' %t/allowed-dependencies.txt; fi
11-
129
// RUN: %llvm-nm --undefined-only --format=just-symbols %t/a.o | sort | tee %t/actual-dependencies.txt
1310

1411
// Fail if there is any entry in actual-dependencies.txt that's not in allowed-dependencies.txt
1512
// RUN: test -z "`comm -13 %t/allowed-dependencies.txt %t/actual-dependencies.txt`"
1613

14+
// DEP-WASM: ___indirect_function_table
15+
// DEP-WASM: ___memory_base
1716
// DEP: ___stack_chk_fail
1817
// DEP: ___stack_chk_guard
18+
// DEP-WASM: ___stack_pointer
1919
// DEP: _arc4random_buf
2020
// DEP: _free
2121
// DEP: _memmove

0 commit comments

Comments
 (0)