Skip to content

Commit

Permalink
[InstallAPI] Add test to validate cc1 arg forwarding (#87666)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyndyishida committed Apr 5, 2024
1 parent 62b58d3 commit 1c683eb
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@interface NSObject
@end

typedef unsigned char BOOL;
#ifndef NS_AVAILABLE
#define NS_AVAILABLE(x,y) __attribute__((availability(macosx,introduced=x)))
#endif
#ifndef NS_UNAVAILABLE
#define NS_UNAVAILABLE __attribute__((unavailable))
#endif
#ifndef NS_DEPRECATED_MAC
#define NS_DEPRECATED_MAC(x,y) __attribute__((availability(macosx,introduced=x,deprecated=y,message="" )));
#endif

@interface NSManagedObject
@end

@interface NSSet
@end
22 changes: 1 addition & 21 deletions clang/test/InstallAPI/extra-exclude-headers.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
; RUN: split-file %s %t
; RUN: mkdir -p %t/System/Library/Frameworks
; RUN: cp -r %S/Inputs/Simple/Simple.framework %t/System/Library/Frameworks/
; RUN: cp -r %S/Inputs/Foundation/Foundation.framework %t/System/Library/Frameworks/
; RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json
; RUN: yaml2obj %S/Inputs/Simple/Simple.yaml -o %t/Simple

Expand Down Expand Up @@ -184,24 +185,3 @@
],
"version": "3"
}

;--- System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
@interface NSObject
@end

typedef unsigned char BOOL;
#ifndef NS_AVAILABLE
#define NS_AVAILABLE(x,y) __attribute__((availability(macosx,introduced=x)))
#endif
#ifndef NS_UNAVAILABLE
#define NS_UNAVAILABLE __attribute__((unavailable))
#endif
#ifndef NS_DEPRECATED_MAC
#define NS_DEPRECATED_MAC(x,y) __attribute__((availability(macosx,introduced=x,deprecated=y,message="" )));
#endif

@interface NSManagedObject
@end

@interface NSSet
@end
34 changes: 34 additions & 0 deletions clang/test/InstallAPI/forwarded-search-paths.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
; RUN: rm -rf %t
; RUN: split-file %s %t
; RUN: sed -e "s|DSTROOT|%/t|g" %t/input.json.in > %t/input.json

; RUN: mkdir -p %t/System/Library/Frameworks
; RUN: cp -r %S/Inputs/Foundation/Foundation.framework %t/System/Library/Frameworks/
; RUN: cp -r %S/Inputs/Simple/Simple.framework %t/System/Library/Frameworks/
; RUN: yaml2obj %S/Inputs/Simple/Simple.yaml -o %t/Simple
; RUN: mkdir -p %t/usr/include/after

; RUN: clang-installapi -target x86_64-apple-macosx10.12 \
; RUN: -install_name /System/Library/Frameworks/Simple.framework/Versions/A/Simple \
; RUN: -current_version 1.2.3 -compatibility_version 1 -o %t/Simple.tbd \
; RUN: -idirafter %t/usr/include/after \
; RUN: -F %t/System/Library/Frameworks \
; RUN: --verify-against=%t/Simple --verify-mode=ErrorsOnly \
; RUN: %t/input.json -v 2>&1 | FileCheck %s

; CHECK: "-idirafter" {{.*}}/usr/include/after"
; CHECK: #include "..." search starts here:
; CHECK: #include <...> search starts here:
; CHECK: usr/include/after
; CHECK-NEXT: End of search list.

;--- input.json.in
{
"version" : "3",
"headers" : [
{
"type" : "public",
"path" : "DSTROOT/System/Library/Frameworks/Simple.framework/Headers/Basic.h"
}
]
}

0 comments on commit 1c683eb

Please sign in to comment.