Fix ClangImporter directory

This commit is contained in:
Arnold Schwaighofer
2023-05-25 14:13:48 -07:00
parent 0b6db0afc4
commit 2c00862ed9
4 changed files with 145 additions and 164 deletions

View File

@@ -1,17 +1,13 @@
// RUN: %target-swift-frontend %use_no_opaque_pointers -emit-ir -primary-file %s %S/Inputs/forward-declarations-other.swift -import-objc-header %S/Inputs/forward-declarations.h -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name main | %FileCheck %s
// RUN: %target-swift-frontend -emit-ir -primary-file %s %S/Inputs/forward-declarations-other.swift -import-objc-header %S/Inputs/forward-declarations.h -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name main
// RUN: %target-swift-frontend -emit-ir -primary-file %s %S/Inputs/forward-declarations-other.swift -import-objc-header %S/Inputs/forward-declarations.h -enable-objc-interop -disable-objc-attr-requires-foundation-module -module-name main | %FileCheck %s
class Sub: Base {
// CHECK-LABEL: define{{.*}} void @"$s4main3SubC4testyyF"
func test() {
// CHECK: [[BASE_SELF:%.+]] = bitcast %T4main3SubC* %0 to %TSo4BaseC*
// CHECK: [[SELECTOR:%.+]] = load i8*, i8** @"\01L_selector(getClassInstanceWithoutMentioningItsName)"
// CHECK: [[OPAQUE_SELF:%.+]] = bitcast %TSo4BaseC* %2 to {{%.+}}*
// CHECK: [[RESULT:%.+]] = call {{%.+}}* bitcast (void ()* @objc_msgSend to {{%.+}}* ({{%.+}}*, i8*)*)({{%.+}}* [[OPAQUE_SELF]], i8* [[SELECTOR]])
// CHECK: [[OPAQUE_RESULT:%.+]] = bitcast {{%.+}}* [[RESULT]] to i8*
// CHECK: call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* [[OPAQUE_RESULT]])
// CHECK: [[SELECTOR:%.+]] = load ptr, ptr @"\01L_selector(getClassInstanceWithoutMentioningItsName)"
// CHECK: [[RESULT:%.+]] = call ptr @objc_msgSend(ptr %{{[0-9]+}}, ptr [[SELECTOR]])
// CHECK: call ptr @llvm.objc.retainAutoreleasedReturnValue(ptr [[RESULT]])
_ = self.getClassInstanceWithoutMentioningItsName()
// CHECK: call void @swift_release(%swift.refcounted* {{%.+}})
// CHECK: call void @swift_release(ptr {{%.+}})
// CHECK: ret void
}
}