brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 7b73dff Raw
145 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: sed -e "s|DSTROOT|%/t|g" %t/inputs.json.in > %t/inputs.json4 5// RUN: clang-installapi -target arm64-apple-macos13.1 \6// RUN: -F%t -install_name /System/Library/Frameworks/Foo.framework/Foo \7// RUN: %t/inputs.json -o %t/outputs.tbd -v 2>&1 | FileCheck %s --check-prefix=VERBOSE8// RUN: llvm-readtapi -compare %t/outputs.tbd %t/expected.tbd 2>&1 | FileCheck %s --allow-empty9 10// VERBOSE:       Public Headers: 11// VERBOSE-NEXT:  #import <Foo/Foo.h> 12// CHECK-NOT:     error:  13// CHECK-NOT:     warning:  14 15//--- Foo.framework/Headers/Foo.h16// Ignore forward declaration. 17@class NSObject;18 19@interface Visible 20@end21 22__attribute__((visibility("hidden")))23@interface Hidden24@end25 26__attribute__((visibility("hidden")))27@interface HiddenWithIvars {28@public 29char _ivar;30}31@end32 33__attribute__((objc_exception))34@interface Exception 35@end36 37@interface PublicClass : Visible  {38@package 39  int _internal;40@protected41  int _external;42@private43  int private;44@public45char _public;46}47@end48 49 50//--- Foo.framework/PrivateHeaders/Foo_Private.h51#import <Foo/Foo.h>52 53@interface ClassWithIvars : Visible  {54  char _ivar1;55  char _ivar2;56@private57  int _privateIVar;58@protected59  int _externalIVar;60@package 61  int _internalIVar;62}63@end64 65@interface Exception () {66@public 67  char _ivarFromExtension;68@private 69  int _privateIvarFromExtension;70}71@end72 73 74//--- inputs.json.in75{76  "headers": [ {77    "path" : "DSTROOT/Foo.framework/Headers/Foo.h",78    "type" : "public"79  }, 80  {81    "path" : "DSTROOT/Foo.framework/PrivateHeaders/Foo_Private.h",82    "type" : "private"83  }84  ],85  "version": "3"86}87 88//--- expected.tbd89{90  "main_library": {91    "compatibility_versions": [92      {93        "version": "0"94      }95    ],96    "current_versions": [97      {98        "version": "0"99      }100    ],101    "exported_symbols": [102      {103        "data": {104          "objc_class": [105            "PublicClass",106            "Exception",107            "Visible",108            "ClassWithIvars"109          ],110          "objc_eh_type": [111            "Exception"112          ],113          "objc_ivar": [114            "Exception._ivarFromExtension",115            "ClassWithIvars._ivar2",116            "PublicClass._external",117            "ClassWithIvars._ivar1",118            "ClassWithIvars._externalIVar",119            "PublicClass._public"120          ]121        }122      }123    ],124    "flags": [125      {126        "attributes": [127          "not_app_extension_safe"128        ]129      }130    ],131    "install_names": [132      {133        "name": "/System/Library/Frameworks/Foo.framework/Foo"134      }135    ],136    "target_info": [137      {138        "min_deployment": "13.1",139        "target": "arm64-macos"140      }141    ]142  },143  "tapi_tbd_version": 5144}145