65 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: %clang_cc1 -extract-api --pretty-sgf --emit-sgf-symbol-labels-for-testing \4// RUN: --emit-extension-symbol-graphs --symbol-graph-dir=%t/symbols \5// RUN: --product-name=Module -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules-cache \6// RUN: -triple arm64-apple-macosx -x objective-c-header %t/input.h -verify7// RUN: %clang_cc1 -extract-api --pretty-sgf --emit-sgf-symbol-labels-for-testing \8// RUN: --product-name=Module -o %t/ModuleNoExt.symbols.json -triple arm64-apple-macosx \9// RUN: -x objective-c-header %t/input.h10 11//--- input.h12#include "ExternalModule.h"13 14@interface ExtInterface (Category)15@property int Property;16- (void)InstanceMethod;17+ (void)ClassMethod;18@end19 20@interface ModInterface21@end22 23// expected-no-diagnostics24 25//--- ExternalModule.h26@interface ExtInterface27@end28 29//--- module.modulemap30module ExternalModule {31 header "ExternalModule.h"32}33 34// Main symbol graph from the build with extension SGFs35// RUN: FileCheck %s --input-file %t/symbols/Module.symbols.json --check-prefix MOD36 37// MOD-NOT: "!testRelLabel": "memberOf $ c:objc(cs)ExtInterface(py)Property $ c:objc(cs)ExtInterface"38// MOD-NOT: "!testRelLabel": "memberOf $ c:objc(cs)ExtInterface(im)InstanceMethod $ c:objc(cs)ExtInterface"39// MOD-NOT: "!testRelLabel": "memberOf $ c:objc(cs)ExtInterface(cm)ClassMethod $ c:objc(cs)ExtInterface"40// MOD-NOT: "c:objc(cs)ExtInterface(py)Property"41// MOD-NOT: "c:objc(cs)ExtInterface(im)InstanceMethod"42// MOD-NOT: "c:objc(cs)ExtInterface(cm)ClassMethod"43// MOD-NOT: "c:objc(cs)ExtInterface"44// MOD-DAG: "c:objc(cs)ModInterface"45 46// Symbol graph from the build without extension SGFs should be identical to main symbol graph with extension SGFs47// RUN: diff %t/symbols/Module.symbols.json %t/ModuleNoExt.symbols.json48 49// RUN: FileCheck %s --input-file %t/symbols/Module@ExternalModule.symbols.json --check-prefix EXT50// EXT-DAG: "!testRelLabel": "memberOf $ c:objc(cs)ExtInterface(py)Property $ c:objc(cs)ExtInterface"51// EXT-DAG: "!testRelLabel": "memberOf $ c:objc(cs)ExtInterface(im)InstanceMethod $ c:objc(cs)ExtInterface"52// EXT-DAG: "!testRelLabel": "memberOf $ c:objc(cs)ExtInterface(cm)ClassMethod $ c:objc(cs)ExtInterface"53// EXT-DAG: "!testLabel": "c:objc(cs)ExtInterface(py)Property"54// EXT-DAG: "!testLabel": "c:objc(cs)ExtInterface(im)InstanceMethod"55// EXT-DAG: "!testLabel": "c:objc(cs)ExtInterface(cm)ClassMethod"56// EXT-NOT: "!testLabel": "c:objc(cs)ExtInterface"57// EXT-NOT: "!testLabel": "c:objc(cs)ModInterface"58 59// Ensure that the 'module' metadata for the extension symbol graph should still reference the60// declaring module61 62// RUN: FileCheck %s --input-file %t/symbols/Module@ExternalModule.symbols.json --check-prefix META63// META: "module": {64// META-NEXT: "name": "Module",65