[DAG] TransformFPLoadStorePair - early out if we're not loading a simple type
[llvm-project.git] / clang / test / APINotes / versioned.m
blob264edde2a04fce55bb4bbaf33a9d710b90009fc7
1 // RUN: rm -rf %t && mkdir -p %t
3 // Build and check the unversioned module file.
4 // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Unversioned -fdisable-module-hash -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s
5 // RUN: %clang_cc1 -ast-print %t/ModulesCache/Unversioned/VersionedKit.pcm | FileCheck -check-prefix=CHECK-UNVERSIONED %s
6 // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Unversioned -fdisable-module-hash -fapinotes-modules -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter 'DUMP' | FileCheck -check-prefix=CHECK-DUMP -check-prefix=CHECK-UNVERSIONED-DUMP %s
8 // Build and check the versioned module file.
9 // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Versioned -fdisable-module-hash -fapinotes-modules -fapinotes-swift-version=3 -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s
10 // RUN: %clang_cc1 -ast-print %t/ModulesCache/Versioned/VersionedKit.pcm | FileCheck -check-prefix=CHECK-VERSIONED %s
11 // RUN: %clang_cc1 -fmodules -fblocks -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache/Versioned -fdisable-module-hash -fapinotes-modules -fapinotes-swift-version=3 -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -ast-dump -ast-dump-filter 'DUMP' | FileCheck -check-prefix=CHECK-DUMP -check-prefix=CHECK-VERSIONED-DUMP %s
13 #import <VersionedKit/VersionedKit.h>
15 // CHECK-UNVERSIONED: void moveToPointDUMP(double x, double y) __attribute__((swift_name("moveTo(x:y:)")));
16 // CHECK-VERSIONED:__attribute__((swift_name("moveTo(a:b:)"))) void moveToPointDUMP(double x, double y);
18 // CHECK-DUMP-LABEL: Dumping moveToPointDUMP
19 // CHECK-VERSIONED-DUMP: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0 IsReplacedByActive{{$}}
20 // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "moveTo(x:y:)"
21 // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "moveTo(a:b:)"
22 // CHECK-UNVERSIONED-DUMP: SwiftNameAttr {{.+}} "moveTo(x:y:)"
23 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}}
24 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "moveTo(a:b:)"
25 // CHECK-DUMP-NOT: Attr
27 // CHECK-DUMP-LABEL: Dumping unversionedRenameDUMP
28 // CHECK-DUMP: in VersionedKit unversionedRenameDUMP
29 // CHECK-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 0 IsReplacedByActive{{$}}
30 // CHECK-DUMP-NEXT: SwiftNameAttr {{.+}} "unversionedRename_HEADER()"
31 // CHECK-DUMP-NEXT: SwiftNameAttr {{.+}} "unversionedRename_NOTES()"
32 // CHECK-DUMP-NOT: Attr
34 // CHECK-DUMP-LABEL: Dumping TestGenericDUMP
35 // CHECK-VERSIONED-DUMP: SwiftImportAsNonGenericAttr {{.+}} <<invalid sloc>>
36 // CHECK-UNVERSIONED-DUMP: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}}
37 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftImportAsNonGenericAttr {{.+}} <<invalid sloc>>
38 // CHECK-DUMP-NOT: Attr
40 // CHECK-DUMP-LABEL: Dumping Swift3RenamedOnlyDUMP
41 // CHECK-DUMP: in VersionedKit Swift3RenamedOnlyDUMP
42 // CHECK-VERSIONED-DUMP-NEXT: SwiftVersionedRemovalAttr {{.+}} Implicit 3.0 {{[0-9]+}} IsReplacedByActive{{$}}
43 // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "SpecialSwift3Name"
44 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}}
45 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SpecialSwift3Name"
46 // CHECK-DUMP-NOT: Attr
48 // CHECK-DUMP-LABEL: Dumping Swift3RenamedAlsoDUMP
49 // CHECK-DUMP: in VersionedKit Swift3RenamedAlsoDUMP
50 // CHECK-VERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0 IsReplacedByActive{{$}}
51 // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <line:{{.+}}, col:{{.+}}> "Swift4Name"
52 // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "SpecialSwift3Also"
53 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <line:{{.+}}, col:{{.+}}> "Swift4Name"
54 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 3.0{{$}}
55 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SpecialSwift3Also"
56 // CHECK-DUMP-NOT: Attr
58 // CHECK-DUMP-LABEL: Dumping Swift4RenamedDUMP
59 // CHECK-DUMP: in VersionedKit Swift4RenamedDUMP
60 // CHECK-VERSIONED-DUMP-NEXT: SwiftVersionedRemovalAttr {{.+}} Implicit 4 {{[0-9]+}} IsReplacedByActive{{$}}
61 // CHECK-VERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} "SpecialSwift4Name"
62 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftVersionedAdditionAttr {{.+}} Implicit 4{{$}}
63 // CHECK-UNVERSIONED-DUMP-NEXT: SwiftNameAttr {{.+}} <<invalid sloc>> "SpecialSwift4Name"
64 // CHECK-DUMP-NOT: Attr
66 // CHECK-DUMP-NOT: Dumping
68 // CHECK-UNVERSIONED: void acceptClosure(__attribute__((noescape)) void (^block)(void));
69 // CHECK-VERSIONED: void acceptClosure(void (^block)(void));
71 // CHECK-UNVERSIONED: void privateFunc(void) __attribute__((swift_private));
73 // CHECK-UNVERSIONED: typedef double MyDoubleWrapper __attribute__((swift_wrapper("struct")));
75 // CHECK-UNVERSIONED:      enum __attribute__((ns_error_domain(MyErrorDomain))) MyErrorCode {
76 // CHECK-UNVERSIONED-NEXT:     MyErrorCodeFailed = 1
77 // CHECK-UNVERSIONED-NEXT: };
79 // CHECK-UNVERSIONED: __attribute__((swift_bridge("MyValueType")))
80 // CHECK-UNVERSIONED: @interface MyReferenceType
82 // CHECK-VERSIONED: void privateFunc(void);
84 // CHECK-VERSIONED: typedef double MyDoubleWrapper;
86 // CHECK-VERSIONED:      enum MyErrorCode {
87 // CHECK-VERSIONED-NEXT:     MyErrorCodeFailed = 1
88 // CHECK-VERSIONED-NEXT: };
90 // CHECK-VERSIONED-NOT: __attribute__((swift_bridge("MyValueType")))
91 // CHECK-VERSIONED: @interface MyReferenceType
93 // CHECK-UNVERSIONED: __attribute__((swift_objc_members)
94 // CHECK-UNVERSIONED-NEXT: @interface TestProperties
95 // CHECK-VERSIONED-NOT: __attribute__((swift_objc_members)
96 // CHECK-VERSIONED: @interface TestProperties
98 // CHECK-UNVERSIONED-LABEL: enum __attribute__((flag_enum)) FlagEnum {
99 // CHECK-UNVERSIONED-NEXT:     FlagEnumA = 1,
100 // CHECK-UNVERSIONED-NEXT:     FlagEnumB = 2
101 // CHECK-UNVERSIONED-NEXT: };
102 // CHECK-UNVERSIONED-LABEL: enum __attribute__((flag_enum)) NewlyFlagEnum {
103 // CHECK-UNVERSIONED-NEXT:     NewlyFlagEnumA = 1,
104 // CHECK-UNVERSIONED-NEXT:     NewlyFlagEnumB = 2
105 // CHECK-UNVERSIONED-NEXT: };
106 // CHECK-UNVERSIONED-LABEL: enum __attribute__((flag_enum)) APINotedFlagEnum {
107 // CHECK-UNVERSIONED-NEXT:     APINotedFlagEnumA = 1,
108 // CHECK-UNVERSIONED-NEXT:     APINotedFlagEnumB = 2
109 // CHECK-UNVERSIONED-NEXT: };
110 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) OpenEnum {
111 // CHECK-UNVERSIONED-NEXT:     OpenEnumA = 1
112 // CHECK-UNVERSIONED-NEXT: };
113 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) NewlyOpenEnum {
114 // CHECK-UNVERSIONED-NEXT:     NewlyOpenEnumA = 1
115 // CHECK-UNVERSIONED-NEXT: };
116 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("closed"))) NewlyClosedEnum {
117 // CHECK-UNVERSIONED-NEXT:     NewlyClosedEnumA = 1
118 // CHECK-UNVERSIONED-NEXT: };
119 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) ClosedToOpenEnum {
120 // CHECK-UNVERSIONED-NEXT:     ClosedToOpenEnumA = 1
121 // CHECK-UNVERSIONED-NEXT: };
122 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("closed"))) OpenToClosedEnum {
123 // CHECK-UNVERSIONED-NEXT:     OpenToClosedEnumA = 1
124 // CHECK-UNVERSIONED-NEXT: };
125 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) APINotedOpenEnum {
126 // CHECK-UNVERSIONED-NEXT:     APINotedOpenEnumA = 1
127 // CHECK-UNVERSIONED-NEXT: };
128 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("closed"))) APINotedClosedEnum {
129 // CHECK-UNVERSIONED-NEXT:     APINotedClosedEnumA = 1
130 // CHECK-UNVERSIONED-NEXT: };
132 // CHECK-VERSIONED-LABEL: enum __attribute__((flag_enum)) FlagEnum {
133 // CHECK-VERSIONED-NEXT:     FlagEnumA = 1,
134 // CHECK-VERSIONED-NEXT:     FlagEnumB = 2
135 // CHECK-VERSIONED-NEXT: };
136 // CHECK-VERSIONED-LABEL: enum NewlyFlagEnum {
137 // CHECK-VERSIONED-NEXT:     NewlyFlagEnumA = 1,
138 // CHECK-VERSIONED-NEXT:     NewlyFlagEnumB = 2
139 // CHECK-VERSIONED-NEXT: };
140 // CHECK-VERSIONED-LABEL: enum __attribute__((flag_enum)) APINotedFlagEnum {
141 // CHECK-VERSIONED-NEXT:     APINotedFlagEnumA = 1,
142 // CHECK-VERSIONED-NEXT:     APINotedFlagEnumB = 2
143 // CHECK-VERSIONED-NEXT: };
144 // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) OpenEnum {
145 // CHECK-VERSIONED-NEXT:     OpenEnumA = 1
146 // CHECK-VERSIONED-NEXT: };
147 // CHECK-VERSIONED-LABEL: enum NewlyOpenEnum {
148 // CHECK-VERSIONED-NEXT:     NewlyOpenEnumA = 1
149 // CHECK-VERSIONED-NEXT: };
150 // CHECK-VERSIONED-LABEL: enum NewlyClosedEnum {
151 // CHECK-VERSIONED-NEXT:     NewlyClosedEnumA = 1
152 // CHECK-VERSIONED-NEXT: };
153 // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) ClosedToOpenEnum {
154 // CHECK-VERSIONED-NEXT:     ClosedToOpenEnumA = 1
155 // CHECK-VERSIONED-NEXT: };
156 // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) OpenToClosedEnum {
157 // CHECK-VERSIONED-NEXT:     OpenToClosedEnumA = 1
158 // CHECK-VERSIONED-NEXT: };
159 // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("open"))) APINotedOpenEnum {
160 // CHECK-VERSIONED-NEXT:     APINotedOpenEnumA = 1
161 // CHECK-VERSIONED-NEXT: };
162 // CHECK-VERSIONED-LABEL: enum __attribute__((enum_extensibility("closed"))) APINotedClosedEnum {
163 // CHECK-VERSIONED-NEXT:     APINotedClosedEnumA = 1
164 // CHECK-VERSIONED-NEXT: };
166 // These don't actually have versioned information, so we just check them once.
167 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) SoonToBeCFEnum {
168 // CHECK-UNVERSIONED-NEXT:     SoonToBeCFEnumA = 1
169 // CHECK-UNVERSIONED-NEXT: };
170 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) SoonToBeNSEnum {
171 // CHECK-UNVERSIONED-NEXT:     SoonToBeNSEnumA = 1
172 // CHECK-UNVERSIONED-NEXT: };
173 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) __attribute__((flag_enum)) SoonToBeCFOptions {
174 // CHECK-UNVERSIONED-NEXT:     SoonToBeCFOptionsA = 1
175 // CHECK-UNVERSIONED-NEXT: };
176 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("open"))) __attribute__((flag_enum)) SoonToBeNSOptions {
177 // CHECK-UNVERSIONED-NEXT:     SoonToBeNSOptionsA = 1
178 // CHECK-UNVERSIONED-NEXT: };
179 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("closed"))) SoonToBeCFClosedEnum {
180 // CHECK-UNVERSIONED-NEXT:     SoonToBeCFClosedEnumA = 1
181 // CHECK-UNVERSIONED-NEXT: };
182 // CHECK-UNVERSIONED-LABEL: enum  __attribute__((enum_extensibility("closed"))) SoonToBeNSClosedEnum {
183 // CHECK-UNVERSIONED-NEXT:     SoonToBeNSClosedEnumA = 1
184 // CHECK-UNVERSIONED-NEXT: };
185 // CHECK-UNVERSIONED-LABEL: enum UndoAllThatHasBeenDoneToMe {
186 // CHECK-UNVERSIONED-NEXT:     UndoAllThatHasBeenDoneToMeA = 1
187 // CHECK-UNVERSIONED-NEXT: };