| 1 |
; REQUIRES: system-darwin |
| 2 |
; REQUIRES: target-aarch64 |
| 3 |
|
| 4 |
; RUN: rm -rf %t |
| 5 |
; RUN: split-file %s %t |
| 6 |
|
| 7 |
// Build a simple dylib with debug info. |
| 8 |
; RUN: %clang --target=arm64-apple-macos11 -g -dynamiclib %t/foo.c \ |
| 9 |
; RUN: -current_version 1 -compatibility_version 1 -L%t/usr/lib \ |
| 10 |
; RUN: -save-temps -dynamiclib \ |
| 11 |
; RUN: -o %t/foo.dylib -install_name %t/foo.dylib |
| 12 |
; RUN: dsymutil %t/foo.dylib -o %t/foo.dSYM |
| 13 |
|
| 14 |
; RUN: not clang-installapi -x c++ --target=arm64-apple-macos11 \ |
| 15 |
; RUN: -install_name %t/foo.dylib \ |
| 16 |
; RUN: -current_version 1 -compatibility_version 1 \ |
| 17 |
; RUN: -o %t/output.tbd -dynamiclib \ |
| 18 |
; RUN: --verify-against=%t/foo.dylib --dsym=%t/foo.dSYM \ |
| 19 |
; RUN: --verify-mode=Pedantic 2>&1 | FileCheck %s |
| 20 |
|
| 21 |
; CHECK: violations found for arm64 |
| 22 |
; CHECK-DAG: foo.c:5:0: error: no declaration found for exported symbol 'bar' in dynamic library |
| 23 |
; CHECK-DAG: foo.c:1:0: error: no declaration found for exported symbol 'foo' in dynamic library |
| 24 |
|
| 25 |
;--- foo.c |
| 26 |
int foo(void) { |
| 27 |
return 1; |
| 28 |
} |
| 29 |
extern char bar; |
| 30 |
char bar = 'a'; |
| 31 |
|
| 32 |
;--- usr/lib/libSystem.tbd |
| 33 |
--- !tapi-tbd |
| 34 |
tbd-version: 4 |
| 35 |
targets: [ arm64-macos ] |
| 36 |
install-name: '/usr/lib/libSystem.B.dylib' |
| 37 |
exports: |
| 38 |
- targets: [ arm64-macos ] |
| 39 |
symbols: [ dyld_stub_binder ] |
| 40 |
... |