|
1 | 1 | // RUN: %empty-directory(%t)
|
2 | 2 | // RUN: %target-swift-frontend -enable-experimental-feature Embedded %s -c -o %t/a.o
|
| 3 | + |
| 4 | +// RUN: grep DEP\: %s | sed 's#// DEP\: ##' | sort > %t/allowed-dependencies.txt |
| 5 | +// RUN: %llvm-nm --undefined-only --format=just-symbols %t/a.o | sort | tee %t/actual-dependencies.txt |
| 6 | + |
| 7 | +// Fail if there is any entry in actual-dependencies.txt that's not in allowed-dependencies.txt |
| 8 | +// RUN: test -z `comm -13 %t/allowed-dependencies.txt %t/actual-dependencies.txt` |
| 9 | + |
| 10 | +// DEP: ___stack_chk_fail |
| 11 | +// DEP: ___stack_chk_guard |
| 12 | +// DEP: _free |
| 13 | +// DEP: _memset |
| 14 | +// DEP: _putchar |
| 15 | +// DEP: _posix_memalign |
| 16 | + |
3 | 17 | // RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o
|
4 | 18 | // RUN: %target-clang %t/a.o %t/print.o -o %t/a.out
|
5 | 19 | // RUN: %target-run %t/a.out | %FileCheck %s
|
6 | 20 |
|
7 |
| -// backslash is not doing anything, just to make the grep not match its own line |
8 |
| -// RUN: grep DEP-%target-os %s | sed 's#// DEP-%target-os: ##' | sort > %t/expected-dependencies.txt |
9 |
| -// RUN: %llvm-nm --undefined-only --format=just-symbols %t/a.out | sort > %t/actual-dependencies.txt |
10 |
| -// RUN: diff -u %t/expected-dependencies.txt %t/actual-dependencies.txt |
11 |
| - |
12 |
| -// DEP-macosx: ___stack_chk_fail |
13 |
| -// DEP-macosx: ___stack_chk_guard |
14 |
| -// DEP-macosx: _free |
15 |
| -// DEP-macosx: _posix_memalign |
16 |
| -// DEP-macosx: _printf |
17 |
| -// DEP-macosx: _putchar |
18 |
| -// DEP-macosx: dyld_stub_binder |
19 |
| - |
20 |
| -// DEP-linux-gnu: __stack_chk_fail |
21 |
| -// DEP-linux-gnu: __stack_chk_guard |
22 |
| -// DEP-linux-gnu: free |
23 |
| -// DEP-linux-gnu: posix_memalign |
24 |
| -// DEP-linux-gnu: putchar |
25 |
| - |
26 | 21 | // REQUIRES: swift_in_compiler
|
27 | 22 | // REQUIRES: executable_test
|
28 | 23 | // REQUIRES: optimized_stdlib
|
|
0 commit comments