Skip to content

Commit 28b1585

Browse files
committed
Fix tests due to clang namespacing USR changes
1 parent 792d7c0 commit 28b1585

File tree

10 files changed

+85
-87
lines changed

10 files changed

+85
-87
lines changed

lib/PrintAsObjC/PrintAsObjC.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,9 @@ class ModuleWriter {
23302330
"#if !defined(__has_feature)\n"
23312331
"# define __has_feature(x) 0\n"
23322332
"#endif\n"
2333+
"#if !defined(__has_warning)\n"
2334+
"# define __has_warning(x) 0\n"
2335+
"#endif\n"
23332336
"\n"
23342337
"#if __has_attribute(external_source_symbol)\n"
23352338
"# define SWIFT_STRINGIFY(str) #str\n"
@@ -2698,7 +2701,10 @@ class ModuleWriter {
26982701
out <<
26992702
"#pragma clang diagnostic ignored \"-Wproperty-attribute-mismatch\"\n"
27002703
"#pragma clang diagnostic ignored \"-Wduplicate-method-arg\"\n"
2701-
"#pragma clang diagnostic ignored \"-Wpragma-clang-attribute\"\n"
2704+
"#if __has_warning(\"-Wpragma-clang-attribute\")\n"
2705+
"# pragma clang diagnostic ignored \"-Wpragma-clang-attribute\"\n"
2706+
"#endif\n"
2707+
"#pragma clang diagnostic ignored \"-Wunknown-pragmas\"\n"
27022708
"\n"
27032709
"SWIFT_MODULE_NAMESPACE_PUSH(\"" << M.getNameStr() << "\")\n"
27042710
<< os.str()

test/IDE/comment_to_xml.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//===--- Check that we convert comments to XML correctly.
22

33
// RUN: %target-swift-frontend -typecheck -verify -disable-objc-attr-requires-foundation-module %S/../Inputs/comment_to_something_conversion.swift
4-
// RUN: %target-swift-ide-test -print-comments -source-filename %S/../Inputs/comment_to_something_conversion.swift -comments-xml-schema %S/../../bindings/xml/comment-xml-schema.rng > %t.txt
4+
// RUN: %target-swift-ide-test -module-name comment_to_xml -print-comments -source-filename %S/../Inputs/comment_to_something_conversion.swift -comments-xml-schema %S/../../bindings/xml/comment-xml-schema.rng > %t.txt
55
// RUN: %FileCheck %S/../Inputs/comment_to_something_conversion.swift < %t.txt
66
// RUN: %FileCheck %s -check-prefix=WRONG < %t.txt
77

test/IDE/print_usrs.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -156,36 +156,36 @@ class Observers {
156156
}
157157
}
158158

159-
// CHECK: [[@LINE+2]]:7 c:objc(cs)ObjCClass1{{$}}
159+
// CHECK: [[@LINE+2]]:7 c:@M@swift_ide_test@objc(cs)ObjCClass1{{$}}
160160
@objc
161161
class ObjCClass1 {
162-
// CHECK: [[@LINE+1]]:7 c:objc(cs)ObjCClass1(py)instanceVar{{$}}
162+
// CHECK: [[@LINE+1]]:7 c:@M@swift_ide_test@objc(cs)ObjCClass1(py)instanceVar{{$}}
163163
var instanceVar: Int = 1
164-
// CHECK: [[@LINE+1]]:14 c:objc(cs)ObjCClass1(cpy)typeVar{{$}}
164+
// CHECK: [[@LINE+1]]:14 c:@M@swift_ide_test@objc(cs)ObjCClass1(cpy)typeVar{{$}}
165165
static var typeVar: Int = 1
166166

167-
// CHECK: [[@LINE+1]]:7 c:objc(cs)ObjCClass1(py)computed{{$}}
167+
// CHECK: [[@LINE+1]]:7 c:@M@swift_ide_test@objc(cs)ObjCClass1(py)computed{{$}}
168168
var computed: Int {
169-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(im)computed{{$}}
169+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)computed{{$}}
170170
get { return 1}
171-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(im)setComputed:{{$}}
171+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)setComputed:{{$}}
172172
set {}
173173
}
174174

175-
// CHECK: [[@LINE+1]]:13 c:objc(cs)ObjCClass1(cpy)typeComputed{{$}}
175+
// CHECK: [[@LINE+1]]:13 c:@M@swift_ide_test@objc(cs)ObjCClass1(cpy)typeComputed{{$}}
176176
class var typeComputed: Int {
177-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(cm)typeComputed{{$}}
177+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(cm)typeComputed{{$}}
178178
get { return 1 }
179-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(cm)setTypeComputed:{{$}}
179+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(cm)setTypeComputed:{{$}}
180180
set {}
181181
}
182182

183-
// CHECK: [[@LINE+1]]:3 c:objc(cs)ObjCClass1(im)initWithX:{{$}}
183+
// CHECK: [[@LINE+1]]:3 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)initWithX:{{$}}
184184
init(x: Int) {}
185-
// CHECK: [[@LINE+1]]:3 c:objc(cs)ObjCClass1(im)init{{$}}
185+
// CHECK: [[@LINE+1]]:3 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)init{{$}}
186186
init() {}
187187

188-
// CHECK: [[@LINE+1]]:8 c:objc(cs)ObjCClass1(im)instanceFunc1:{{$}}
188+
// CHECK: [[@LINE+1]]:8 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)instanceFunc1:{{$}}
189189
func instanceFunc1(_ a: Int) {
190190

191191
// CHECK: [[@LINE+1]]:16 s:14swift_ide_test10ObjCClass1C13instanceFunc1ySiF9LocalEnumL_O
@@ -194,28 +194,28 @@ class ObjCClass1 {
194194
case someCase
195195
}
196196
}
197-
// CHECK: [[@LINE+1]]:14 c:objc(cs)ObjCClass1(cm)staticFunc1:{{$}}
197+
// CHECK: [[@LINE+1]]:14 c:@M@swift_ide_test@objc(cs)ObjCClass1(cm)staticFunc1:{{$}}
198198
class func staticFunc1(_ a: Int) {}
199199

200200
// CHECK: [[@LINE+2]]:10 s:14swift_ide_test10ObjCClass1C9subscriptS2ici{{$}}
201201
// CHECK: [[@LINE+1]]:20 s:14swift_ide_test10ObjCClass1C1xL_Siv{{$}}
202202
public subscript(x: Int) -> Int {
203203

204-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(im)objectAtIndexedSubscript:{{$}}
204+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)objectAtIndexedSubscript:{{$}}
205205
get { return 1 }
206206

207-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(im)setObject:atIndexedSubscript:{{$}}
207+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)setObject:atIndexedSubscript:{{$}}
208208
set {}
209209
}
210210

211211
// CHECK: [[@LINE+2]]:10 s:14swift_ide_test10ObjCClass1C9subscriptSiACci{{$}}
212212
// CHECK: [[@LINE+1]]:20 s:14swift_ide_test10ObjCClass1C1xL_ACv{{$}}
213213
public subscript(x: ObjCClass1) -> Int {
214214

215-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(im)objectForKeyedSubscript:{{$}}
215+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)objectForKeyedSubscript:{{$}}
216216
get { return 1 }
217217

218-
// CHECK: [[@LINE+1]]:5 c:objc(cs)ObjCClass1(im)setObject:forKeyedSubscript:{{$}}
218+
// CHECK: [[@LINE+1]]:5 c:@M@swift_ide_test@objc(cs)ObjCClass1(im)setObject:forKeyedSubscript:{{$}}
219219
set {}
220220
}
221221

@@ -224,22 +224,22 @@ class ObjCClass1 {
224224
@objc class Nested {}
225225
}
226226

227-
// CHECK: [[@LINE+1]]:23 c:objc(pl)ObjCProto{{$}}
227+
// CHECK: [[@LINE+1]]:23 c:@M@swift_ide_test@objc(pl)ObjCProto{{$}}
228228
@objc public protocol ObjCProto {
229229

230-
// CHECK: [[@LINE+1]]:8 c:objc(pl)ObjCProto(im)protoMeth{{$}}
230+
// CHECK: [[@LINE+1]]:8 c:@M@swift_ide_test@objc(pl)ObjCProto(im)protoMeth{{$}}
231231
func protoMeth()
232232
}
233233

234-
// CHECK: [[@LINE+1]]:12 c:@E@ObjCEnum{{$}}
234+
// CHECK: [[@LINE+1]]:12 c:@M@swift_ide_test@E@ObjCEnum{{$}}
235235
@objc enum ObjCEnum : Int {
236236

237-
// CHECK: [[@LINE+1]]:8 c:@E@ObjCEnum@ObjCEnumAmazingCase{{$}}
237+
// CHECK: [[@LINE+1]]:8 c:@M@swift_ide_test@E@ObjCEnum@ObjCEnumAmazingCase{{$}}
238238
case amazingCase
239239
}
240240

241241
extension ObjCClass1 {
242-
// CHECK: [[@LINE+1]]:15 c:objc(cs)ObjCClass1(im)objcExtMethodWithX:{{$}}
242+
// CHECK: [[@LINE+1]]:15 c:@CM@swift_ide_test@objc(cs)ObjCClass1(im)objcExtMethodWithX:{{$}}
243243
public func objcExtMethod(x: Int) {}
244244
}
245245

test/Inputs/clang-importer-sdk/usr/include/stdbool.h

Whitespace-only changes.

test/Inputs/clang-importer-sdk/usr/include/stddef.h

Whitespace-only changes.

test/Inputs/clang-importer-sdk/usr/include/stdint.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)