[clang] [CodeGen][Objective-C] Add WebAssembly `@finally` support (PR #218967)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 27 02:08:56 PDT 2026


Hendrik =?utf-8?q?Hübner?= <hhuebner at MacBookPro.localdomain>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/218967 at github.com>


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 91096 tests passed
* 1842 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CodeGenObjC/gnustep2-wasm32-finally.m</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -target-feature +exception-handling -triple wasm32-unknown-emscripten -fobjc-runtime=gnustep-2.2 -fexceptions -fobjc-exceptions -exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -target-feature +exception-handling -triple wasm32-unknown-emscripten -fobjc-runtime=gnustep-2.2 -fexceptions -fobjc-exceptions -exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:31:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup
# |                ^
# | <stdin>:87:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:88:2: note: possible intended match here
# |  to label %invoke.cont1 unwind label %ehcleanup
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:93:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup
# |                ^
# | <stdin>:200:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:201:2: note: possible intended match here
# |  to label %invoke.cont6 unwind label %ehcleanup
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:173:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup
# |                ^
# | <stdin>:321:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:322:2: note: possible intended match here
# |  to label %invoke.cont1 unwind label %ehcleanup
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:257:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup
# |                ^
# | <stdin>:446:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:447:2: note: possible intended match here
# |  to label %invoke.cont6 unwind label %ehcleanup
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:308:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup5
# |                ^
# | <stdin>:524:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:549:2: note: possible intended match here
# |  to label %unreachable unwind label %ehcleanup
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:470:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup
# |                ^
# | <stdin>:770:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:771:2: note: possible intended match here
# |  to label %invoke.cont7 unwind label %ehcleanup
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:605:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup
# |                ^
# | <stdin>:971:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:972:2: note: possible intended match here
# |  to label %invoke.cont unwind label %ehcleanup
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m:654:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup
# |                ^
# | <stdin>:1052:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:1053:2: note: possible intended match here
# |  to label %invoke.cont6 unwind label %ehcleanup
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjC/gnustep2-wasm32-finally.m
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            82:  %cleanup.dest.saved = load i32, ptr %cleanup.dest.slot, align 4 
# |            83:  %finally.shouldthrow = load i1, ptr %finally.for-eh, align 1 
# |            84:  br i1 %finally.shouldthrow, label %finally.rethrow, label %finally.cont 
# |            85:  
# |            86: finally.rethrow: ; preds = %cleanup 
# |            87:  invoke void @__cxa_rethrow() 
# | next:31'0                                  {   search range start (exclusive)
# | next:31'1                                      error: no match found in search range
# |            88:  to label %invoke.cont1 unwind label %ehcleanup 
# | next:31'2       ?                                                possible intended match
# |            89:  
# |            90: invoke.cont1: ; preds = %finally.rethrow 
# |            91:  unreachable 
# |            92:  
# |            93: finally.cont: ; preds = %cleanup 
# |             .
# |             .
# |             .
# |           155: declare i32 @llvm.eh.typeid.for.p0(ptr) #3 
# |           156:  
# |           157: declare void @abort() 
# |           158:  
# |           159: ; Function Attrs: noinline optnone 
# |           160: define i32 @finallySimple(ptr noundef %object) #0 personality ptr @__gxx_wasm_personality_v0 { 
# | next:31'3                               }                                                                       search range end (exclusive)
# |           161: entry: 
# |           162:  %object.addr = alloca ptr, align 4 
# |           163:  %value = alloca i32, align 4 
# |           164:  %finally.for-eh = alloca i1, align 1 
# |           165:  %exn.slot = alloca ptr, align 4 
# |             .
# |             .
# |             .
# |           195:  store i32 %add, ptr %value, align 4 
# |           196:  %finally.shouldthrow = load i1, ptr %finally.for-eh, align 1 
# |           197:  br i1 %finally.shouldthrow, label %finally.rethrow, label %finally.cont 
# |           198:  
# |           199: finally.rethrow: ; preds = %cleanup 
# |           200:  invoke void @__cxa_rethrow() 
# | next:93'0                                  {   search range start (exclusive)
# | next:93'1                                      error: no match found in search range
# |           201:  to label %invoke.cont6 unwind label %ehcleanup 
# | next:93'2       ?                                                possible intended match
# |           202:  
# |           203: invoke.cont6: ; preds = %finally.rethrow 
# |           204:  unreachable 
# |           205:  
# |           206: finally.cont: ; preds = %cleanup 
# |             .
# |             .
# |             .
# |           276:  call void @abort() #5 [ "funclet"(token %13) ] 
# |           277:  unreachable 
# |           278: } 
# |           279:  
# |           280: ; Function Attrs: noinline optnone 
# |           281: define i32 @finallyNoCatch(ptr noundef %object) #0 personality ptr @__gxx_wasm_personality_v0 { 
# | next:93'3                                }                                                                       search range end (exclusive)
# |           282: entry: 
# |           283:  %object.addr = alloca ptr, align 4 
# |           284:  %value = alloca i32, align 4 
# |           285:  %finally.for-eh = alloca i1, align 1 
# |           286:  %exn.slot = alloca ptr, align 4 
# |             .
# |             .
# |             .
# |           316:  store i32 %add, ptr %value, align 4 
# |           317:  %finally.shouldthrow = load i1, ptr %finally.for-eh, align 1 
# |           318:  br i1 %finally.shouldthrow, label %finally.rethrow, label %finally.cont 
# |           319:  
# |           320: finally.rethrow: ; preds = %cleanup 
# |           321:  invoke void @__cxa_rethrow() 
# | next:173'0                                 {   search range start (exclusive)
# | next:173'1                                     error: no match found in search range
# |           322:  to label %invoke.cont1 unwind label %ehcleanup 
# | next:173'2      ?                                                possible intended match
# |           323:  
# |           324: invoke.cont1: ; preds = %finally.rethrow 
# |           325:  unreachable 
# |           326:  
# |           327: finally.cont: ; preds = %cleanup 
# |             .
# |             .
# |             .
# |           369:  call void @abort() #5 [ "funclet"(token %9) ] 
# |           370:  unreachable 
# |           371: } 
# |           372:  
# |           373: ; Function Attrs: noinline optnone 
# |           374: define i32 @throwInTryFinally(ptr noundef %object) #0 personality ptr @__gxx_wasm_personality_v0 { 
# | next:173'3                                  }                                                                       search range end (exclusive)
# |           375: entry: 
# |           376:  %object.addr = alloca ptr, align 4 
# |           377:  %value = alloca i32, align 4 
# |           378:  %finally.for-eh = alloca i1, align 1 
# |           379:  %exn.slot = alloca ptr, align 4 
# |             .
# |             .
# |             .
# |           441:  store i32 %add, ptr %value, align 4 
# |           442:  %finally.shouldthrow = load i1, ptr %finally.for-eh, align 1 
# |           443:  br i1 %finally.shouldthrow, label %finally.rethrow, label %finally.cont 
# |           444:  
# |           445: finally.rethrow: ; preds = %cleanup 
# |           446:  invoke void @__cxa_rethrow() 
# | next:257'0                                 {   search range start (exclusive)
# | next:257'1                                     error: no match found in search range
# |           447:  to label %invoke.cont6 unwind label %ehcleanup 
# | next:257'2      ?                                                possible intended match
# |           448:  
# |           449: invoke.cont6: ; preds = %finally.rethrow 
# |           450:  unreachable 
# |           451:  
# |           452: finally.cont: ; preds = %cleanup 
# |             .
# |             .
# |             .
# |           486: } 
# |           487:  
# |           488: declare void @objc_exception_throw(ptr) 
# |           489:  
# |           490: ; Function Attrs: noinline optnone 
# |           491: define i32 @throwInCatchFinally(ptr noundef %object) #0 personality ptr @__gxx_wasm_personality_v0 { 
# | next:257'3                                    }                                                                       search range end (exclusive)
# |           492: entry: 
# |           493:  %retval = alloca i32, align 4 
# |           494:  %object.addr = alloca ptr, align 4 
# |           495:  %finally.for-eh = alloca i1, align 1 
# |           496:  %exn.slot = alloca ptr, align 4 
# |             .
# |             .
# |             .
# |           519:  %4 = load ptr, ptr %object.addr, align 4 
# |           520:  %finally.shouldthrow = load i1, ptr %finally.for-eh, al
# | ...
# `---data was truncated (10240/16732) (change limit with -D output_limit=N)
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.CodeGenObjCXX/wasm32-eh-objcxx.mm</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -target-feature +exception-handling -triple wasm32-unknown-emscripten -fobjc-runtime=gnustep-2.2 -fexceptions -fobjc-exceptions -fcxx-exceptions -exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --enable-var-scope /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/24/include -nostdsysteminc -target-feature +exception-handling -triple wasm32-unknown-emscripten -fobjc-runtime=gnustep-2.2 -fexceptions -fobjc-exceptions -fcxx-exceptions -exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --enable-var-scope /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm:60:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup4
# |                ^
# | <stdin>:187:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:188:2: note: possible intended match here
# |  to label %invoke.cont4 unwind label %ehcleanup5
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm:129:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: to label %unreachable unwind label %ehcleanup8
# |                ^
# | <stdin>:297:30: note: scanning from here
# |  invoke void @__cxa_rethrow()
# |                              ^
# | <stdin>:298:2: note: possible intended match here
# |  to label %invoke.cont8 unwind label %ehcleanup9
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           182:  %cleanup.dest.saved = load i32, ptr %cleanup.dest.slot, align 4 
# |           183:  %finally.shouldthrow = load i1, ptr %finally.for-eh, align 1 
# |           184:  br i1 %finally.shouldthrow, label %finally.rethrow, label %finally.cont 
# |           185:  
# |           186: finally.rethrow: ; preds = %cleanup 
# |           187:  invoke void @__cxa_rethrow() 
# | next:60'0                                  {   search range start (exclusive)
# | next:60'1                                      error: no match found in search range
# |           188:  to label %invoke.cont4 unwind label %ehcleanup5 
# | next:60'2       ?                                                 possible intended match
# |           189:  
# |           190: invoke.cont4: ; preds = %finally.rethrow 
# |           191:  unreachable 
# |           192:  
# |           193: finally.cont: ; preds = %cleanup 
# |             .
# |             .
# |             .
# |           261: declare void @__cxa_rethrow() 
# |           262:  
# |           263: declare void @_Z12mayThrowObjCv() #1 
# |           264:  
# |           265: ; Function Attrs: mustprogress noinline optnone 
# |           266: define noundef i32 @_Z21cleanupInCatchFinallyv() #0 personality ptr @__gxx_wasm_personality_v0 { 
# | next:60'3                                                    }                                                    search range end (exclusive)
# |           267: entry: 
# |           268:  %retval = alloca i32, align 4 
# |           269:  %finally.for-eh = alloca i1, align 1 
# |           270:  %exn.slot = alloca ptr, align 4 
# |           271:  %object = alloca %struct.ThrowingDestructor, align 1 
# |             .
# |             .
# |             .
# |           292:  %cleanup.dest.saved = load i32, ptr %cleanup.dest.slot, align 4 
# |           293:  %finally.shouldthrow = load i1, ptr %finally.for-eh, align 1 
# |           294:  br i1 %finally.shouldthrow, label %finally.rethrow, label %finally.cont 
# |           295:  
# |           296: finally.rethrow: ; preds = %cleanup 
# |           297:  invoke void @__cxa_rethrow() 
# | next:129'0                                 {   search range start (exclusive)
# | next:129'1                                     error: no match found in search range
# |           298:  to label %invoke.cont8 unwind label %ehcleanup9 
# | next:129'2      ?                                                 possible intended match
# |           299:  
# |           300: invoke.cont8: ; preds = %finally.rethrow 
# |           301:  unreachable 
# |           302:  
# |           303: finally.cont: ; preds = %cleanup 
# |             .
# |             .
# |             .
# |           394:  call void @_ZSt9terminatev() #6 [ "funclet"(token %13) ] 
# |           395:  unreachable 
# |           396: } 
# |           397:  
# |           398: ; Function Attrs: mustprogress noinline optnone 
# |           399: define noundef i32 @_Z17combinedCxxObjcEHv() #0 personality ptr @__gxx_wasm_personality_v0 { 
# | next:129'3                                               }                                                    search range end (exclusive)
# |           400: entry: 
# |           401:  %retval = alloca i32, align 4 
# |           402:  %exn.slot = alloca ptr, align 4 
# |           403:  %value = alloca i32, align 4 
# |           404:  %exception = alloca ptr, align 4 
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/218967


More information about the cfe-commits mailing list