[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / ExtractAPI / objc_external_category.m
blob8afc92489f28b63feb922ccce68193a5a5fcd9dc
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // 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 -verify
7 // 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.h
11 //--- input.h
12 #include "ExternalModule.h"
14 @interface ExtInterface (Category)
15 @property int Property;
16 - (void)InstanceMethod;
17 + (void)ClassMethod;
18 @end
20 @interface ModInterface
21 @end
23 // expected-no-diagnostics
25 //--- ExternalModule.h
26 @interface ExtInterface
27 @end
29 //--- module.modulemap
30 module ExternalModule {
31     header "ExternalModule.h"
34 // Main symbol graph from the build with extension SGFs
35 // RUN: FileCheck %s --input-file  %t/symbols/Module.symbols.json --check-prefix MOD
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"
46 // Symbol graph from the build without extension SGFs should be identical to main symbol graph with extension SGFs
47 // RUN: diff %t/symbols/Module.symbols.json %t/ModuleNoExt.symbols.json
49 // RUN: FileCheck %s --input-file %t/symbols/ExternalModule@Module.symbols.json --check-prefix EXT
50 // 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"