File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
test/Interop/Cxx/exceptions Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: split-file %s %t
3
+
4
+ // RUN: %target-swift-emit-ir %t/test.swift -I %t/Inputs -enable-experimental-cxx-interop | %FileCheck %s
5
+
6
+ // REQUIRES: objc_interop
7
+ // UNSUPPORTED: OS=windows-msvc
8
+
9
+ //--- Inputs/module.modulemap
10
+ module ObjCXXModule {
11
+ header " objCXXHeader.h "
12
+ }
13
+
14
+ //--- Inputs/objCXXHeader.h
15
+
16
+ @interface ObjCInterface
17
+
18
+ - ( void) method;
19
+
20
+ @end
21
+
22
+ ObjCInterface * _Nonnull retObjCInterface( ) noexcept;
23
+
24
+ //--- test.swift
25
+
26
+ import ObjCXXModule
27
+
28
+ func testObjCMethodCall( ) {
29
+ let obj = retObjCInterface ( ) ;
30
+ obj. method ( ) ;
31
+ }
32
+
33
+ testObjCMethodCall ( )
34
+
35
+ // CHECK: define {{.*}} @"$s4test0A14ObjCMethodCallyyF"() #[[#UWATTR:]] personality
36
+ // CHECK: invoke void {{.*}} @objc_msgSend
37
+ // CHECK-NEXT: to label %[[CONT1:.*]] unwind label %[[UNWIND1:.*]]
38
+ // CHECK-EMPTY:
39
+ // CHECK-NEXT: [[CONT1]]:
40
+ // CHECK: ret
41
+ // CHECK-EMPTY:
42
+ // CHECK-NEXT: [[UNWIND1]]:
43
+ // CHECK-NEXT: landingpad { i8*, i32 }
44
+ // CHECK-NEXT: catch i8* null
45
+ // CHECK-NEXT: call void @llvm.trap()
46
+ // CHECK-NEXT: unreachable
47
+ // CHECK-NEXT: }
You can’t perform that action at this time.
0 commit comments