- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathPartialSubmoduleExport.swift
85 lines (62 loc) · 2.46 KB
/
PartialSubmoduleExport.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %target-swift-symbolgraph-extract -sdk %clang-importer-sdk -module-name PartialSubmoduleExport -I %t/PartialSubmoduleExport -output-dir %t -pretty-print -v
// RUN: %FileCheck %s --input-file %t/PartialSubmoduleExport.symbols.json
// check the missing symbols separately to account for arbitrary ordering
// RUN: %FileCheck %s --input-file %t/PartialSubmoduleExport.symbols.json --check-prefix MISSING
// REQUIRES: objc_interop
// The PartialSubmoduleExport module below is structured like this:
// PartialSubmoduleExport
// - GroupA
// - GroupAOne
// - GroupATwo
// - GroupB
// - GroupBOne
// - GroupBTwo
// The module map then exports `GroupA.*` and `GroupB.GroupBOne` explicitly.
// This test ensures that the expected symbols are in the module map,
// and that the deliberately excluded `groupBTwo` symbol is left out.
//--- PartialSubmoduleExport/module.modulemap
module PartialSubmoduleExport {
header "PartialSubmoduleExport.h"
explicit module GroupA {
umbrella header "GroupA/GroupA.h"
module *{ export *}
}
explicit module GroupB {
umbrella header "GroupB/GroupB.h"
module *{ export *}
}
export GroupA.*
export GroupB.GroupBOne
}
//--- PartialSubmoduleExport/PartialSubmoduleExport.h
#include "GroupA/GroupA.h"
#include "GroupB/GroupB.h"
// CHECK-DAG: "precise": "c:PartialSubmoduleExport.h@umbrellaVar"
static int umbrellaVar =0;
//--- PartialSubmoduleExport/GroupA/GroupA.h
#include "GroupAOne.h"
#include "GroupATwo.h"
// CHECK-DAG: "precise": "c:GroupA.h@groupAVar"
static int groupAVar =0;
//--- PartialSubmoduleExport/GroupA/GroupAOne.h
// CHECK-DAG: "precise": "c:GroupAOne.h@groupAOne"
static int groupAOne =1;
//--- PartialSubmoduleExport/GroupA/GroupATwo.h
// CHECK-DAG: "precise": "c:GroupATwo.h@groupATwo"
static int groupATwo =2;
//--- PartialSubmoduleExport/GroupB/GroupB.h
#include "GroupBOne.h"
#include "GroupBTwo.h"
// Because GroupB was not exported by itself, this symbol should be missing
// MISSING-NOT: "precise": "c:GroupB.h@groupBVar"
static int groupBVar =0;
//--- PartialSubmoduleExport/GroupB/GroupBOne.h
// CHECK-DAG: "precise": "c:GroupBOne.h@groupBOne"
static int groupBOne =1;
//--- PartialSubmoduleExport/GroupB/GroupBTwo.h
// Because GroupBTwo is not exported in the top-level module map,
// this shouldn't be in the symbol graph
// MISSING-NOT: "precise": "c:GroupBTwo.h@groupBTwo"
static int groupBTwo =2;