Skip to content

Commit 1c683eb

Browse files
authored
[InstallAPI] Add test to validate cc1 arg forwarding (#87666)
1 parent 62b58d3 commit 1c683eb

File tree

3 files changed

+54
-21
lines changed

3 files changed

+54
-21
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@interface NSObject
2+
@end
3+
4+
typedef unsigned char BOOL;
5+
#ifndef NS_AVAILABLE
6+
#define NS_AVAILABLE(x,y) __attribute__((availability(macosx,introduced=x)))
7+
#endif
8+
#ifndef NS_UNAVAILABLE
9+
#define NS_UNAVAILABLE __attribute__((unavailable))
10+
#endif
11+
#ifndef NS_DEPRECATED_MAC
12+
#define NS_DEPRECATED_MAC(x,y) __attribute__((availability(macosx,introduced=x,deprecated=y,message="" )));
13+
#endif
14+
15+
@interface NSManagedObject
16+
@end
17+
18+
@interface NSSet
19+
@end

clang/test/InstallAPI/extra-exclude-headers.test

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
; RUN: split-file %s %t
33
; RUN: mkdir -p %t/System/Library/Frameworks
44
; RUN: cp -r %S/Inputs/Simple/Simple.framework %t/System/Library/Frameworks/
5+
; RUN: cp -r %S/Inputs/Foundation/Foundation.framework %t/System/Library/Frameworks/
56
; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json
67
; RUN: yaml2obj %S/Inputs/Simple/Simple.yaml -o %t/Simple
78

@@ -184,24 +185,3 @@
184185
],
185186
"version": "3"
186187
}
187-
188-
;--- System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
189-
@interface NSObject
190-
@end
191-
192-
typedef unsigned char BOOL;
193-
#ifndef NS_AVAILABLE
194-
#define NS_AVAILABLE(x,y) __attribute__((availability(macosx,introduced=x)))
195-
#endif
196-
#ifndef NS_UNAVAILABLE
197-
#define NS_UNAVAILABLE __attribute__((unavailable))
198-
#endif
199-
#ifndef NS_DEPRECATED_MAC
200-
#define NS_DEPRECATED_MAC(x,y) __attribute__((availability(macosx,introduced=x,deprecated=y,message="" )));
201-
#endif
202-
203-
@interface NSManagedObject
204-
@end
205-
206-
@interface NSSet
207-
@end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; RUN: rm -rf %t
2+
; RUN: split-file %s %t
3+
; RUN: sed -e "s|DSTROOT|%/t|g" %t/input.json.in > %t/input.json
4+
5+
; RUN: mkdir -p %t/System/Library/Frameworks
6+
; RUN: cp -r %S/Inputs/Foundation/Foundation.framework %t/System/Library/Frameworks/
7+
; RUN: cp -r %S/Inputs/Simple/Simple.framework %t/System/Library/Frameworks/
8+
; RUN: yaml2obj %S/Inputs/Simple/Simple.yaml -o %t/Simple
9+
; RUN: mkdir -p %t/usr/include/after
10+
11+
; RUN: clang-installapi -target x86_64-apple-macosx10.12 \
12+
; RUN: -install_name /System/Library/Frameworks/Simple.framework/Versions/A/Simple \
13+
; RUN: -current_version 1.2.3 -compatibility_version 1 -o %t/Simple.tbd \
14+
; RUN: -idirafter %t/usr/include/after \
15+
; RUN: -F %t/System/Library/Frameworks \
16+
; RUN: --verify-against=%t/Simple --verify-mode=ErrorsOnly \
17+
; RUN: %t/input.json -v 2>&1 | FileCheck %s
18+
19+
; CHECK: "-idirafter" {{.*}}/usr/include/after"
20+
; CHECK: #include "..." search starts here:
21+
; CHECK: #include <...> search starts here:
22+
; CHECK: usr/include/after
23+
; CHECK-NEXT: End of search list.
24+
25+
;--- input.json.in
26+
{
27+
"version" : "3",
28+
"headers" : [
29+
{
30+
"type" : "public",
31+
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/Headers/Basic.h"
32+
}
33+
]
34+
}

0 commit comments

Comments
 (0)