File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
2
// RUN: %target-swift-frontend -parse-as-library -enable-experimental-feature Embedded -enable-experimental-feature Extern %s -c -o %t/a.o
3
3
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
5
5
6
6
// Linux/ELF and Wasm don't use the "_" prefix in symbol mangling.
7
7
// RUN: if [ %target-os == "linux-gnu" ] || [[ %target-os =~ "wasi" ]]; then sed -E -i -e 's/^_(.*)$/\1/' %t/allowed-dependencies.txt; fi
8
8
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
-
12
9
// RUN: %llvm-nm --undefined-only --format=just-symbols %t/a.o | sort | tee %t/actual-dependencies.txt
13
10
14
11
// Fail if there is any entry in actual-dependencies.txt that's not in allowed-dependencies.txt
15
12
// RUN: test -z "`comm -13 %t/allowed-dependencies.txt %t/actual-dependencies.txt`"
16
13
14
+ // DEP-WASM: ___indirect_function_table
15
+ // DEP-WASM: ___memory_base
17
16
// DEP: ___stack_chk_fail
18
17
// DEP: ___stack_chk_guard
18
+ // DEP-WASM: ___stack_pointer
19
19
// DEP: _arc4random_buf
20
20
// DEP: _free
21
21
// DEP: _memmove
You can’t perform that action at this time.
0 commit comments