aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-readtapi/stubify-simple.test
blob: 177301cff918cf80c0c1580fccd898ec005c68fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
; RUN: rm -rf %t
; RUN: split-file %s %t
; RUN: yaml2obj %S/Inputs/flat_namespace.yaml -o %t/flat_namespace.dylib
; RUN: yaml2obj %S/Inputs/thread_local.yaml -o %t/thread_local.dylib
; RUN: yaml2obj %S/Inputs/universal.yaml -o %t/fat.dylib
; RUN: yaml2obj %S/Inputs/objc.yaml -o %t/objc.dylib
; RUN: llvm-readtapi -stubify %t/objc.dylib -o %t/new_objc.tbd 2>&1 | FileCheck %s --allow-empty 
; RUN: llvm-readtapi -stubify %t/objc.dylib %t/flat_namespace.dylib %t/thread_local.dylib %t/fat.dylib -delete-input 2>&1 | FileCheck %s --allow-empty 
; RUN: llvm-readtapi -compare %t/expected_flat.tbd %t/flat_namespace.tbd 2>&1 | FileCheck %s --allow-empty 
; RUN: llvm-readtapi -compare %t/expected_tl.tbd %t/thread_local.tbd 2>&1 | FileCheck %s --allow-empty 
; RUN: llvm-readtapi -compare %t/objc.tbd %t/expected_objc.tbd 2>&1 | FileCheck %s --allow-empty 
; RUN: llvm-readtapi -compare %t/new_objc.tbd %t/expected_objc.tbd 2>&1 | FileCheck %s --allow-empty 

; CHECK-NOT: error: 
; CHECK-NOT: warning: 

;--- expected_flat.tbd
{
  "main_library": {
    "compatibility_versions": [
      {
        "version": "0"
      }
    ],
    "current_versions": [
      {
        "version": "0"
      }
    ],
    "exported_symbols": [
      {
        "text": {
          "global": [ "_foo" ]
        }
      }
    ],
    "flags": [
      {
        "attributes": [
          "flat_namespace",
          "not_app_extension_safe"
        ]
      }
    ],
    "install_names": [
      {
        "name": "foo.dylib"
      }
    ],
    "target_info": [
      {
        "min_deployment": "10.14",
        "target": "x86_64-macos"
      }
    ],
    "undefined_symbols": [
      {
        "data": {
          "global": [ "dyld_stub_binder", "_bar", "_putchar" ]
        }
      }
    ]
  },
  "tapi_tbd_version": 5
}

;--- expected_tl.tbd
{
  "main_library": {
    "compatibility_versions": [
      {
        "version": "0"
      }
    ],
    "current_versions": [
      {
        "version": "0"
      }
    ],
    "exported_symbols": [
      {
        "data": {
          "thread_local": [
            "_MySymbol"
          ]
        }
      }
    ],
    "flags": [
      {
        "attributes": [
          "not_app_extension_safe"
        ]
      }
    ],
    "install_names": [
      {
        "name": "/System/Library/Frameworks/ThreadLocal.framework/ThreadLocal"
      }
    ],
    "target_info": [
      {
        "min_deployment": "11",
        "target": "x86_64-macos"
      }
    ]
  },
  "tapi_tbd_version": 5
}

;--- expected_objc.tbd
{
  "main_library": {
    "compatibility_versions": [
      {
        "version": "0"
      }
    ],
    "current_versions": [
      {
        "version": "0"
      }
    ],
    "exported_symbols": [
      {
        "data": {
          "objc_class": [
            "Suggestion"
          ],
          "objc_ivar": [
            "Suggestion._topChoice",
            "Suggestion._other"
          ]
        }
      }
    ],
    "flags": [
      {
        "attributes": [
          "not_app_extension_safe"
        ]
      }
    ],
    "install_names": [
      {
        "name": "tmp.dylib"
      }
    ],
    "target_info": [
      {
        "min_deployment": "13",
        "target": "arm64-macos"
      }
    ]
  },
  "tapi_tbd_version": 5
}