1 ; RUN: not --crash llc < %s -enable-emscripten-cxx-exceptions -mattr=+multivalue 2>&1 | FileCheck %s --check-prefix=EH
2 ; RUN: not --crash llc < %s -enable-emscripten-sjlj -mattr=+multivalue 2>&1 | FileCheck %s --check-prefix=SJLJ
4 ; Currently multivalue returning functions are not supported in Emscripten EH /
5 ; SjLj. Make sure they error out.
7 target triple = "wasm32-unknown-unknown"
9 %struct.__jmp_buf_tag = type { [6 x i32], i32, [32 x i32] }
11 define void @exception() personality ptr @__gxx_personality_v0 {
13 invoke {i32, i32} @foo(i32 3)
14 to label %try.cont unwind label %lpad
16 lpad: ; preds = %entry
17 %1 = landingpad { ptr, i32 }
19 %2 = extractvalue { ptr, i32 } %1, 0
20 %3 = extractvalue { ptr, i32 } %1, 1
21 %4 = call ptr @__cxa_begin_catch(ptr %2) #2
22 call void @__cxa_end_catch()
25 try.cont: ; preds = %entry, %lpad
29 define void @setjmp_longjmp() {
31 %buf = alloca [1 x %struct.__jmp_buf_tag], align 16
32 %call = call i32 @setjmp(ptr %buf) #0
33 call {i32, i32} @foo(i32 3)
34 call void @longjmp(ptr %buf, i32 1) #1
38 declare {i32, i32} @foo(i32)
39 declare i32 @__gxx_personality_v0(...)
40 declare ptr @__cxa_begin_catch(ptr)
41 declare void @__cxa_end_catch()
42 ; Function Attrs: returns_twice
43 declare i32 @setjmp(ptr) #0
44 ; Function Attrs: noreturn
45 declare void @longjmp(ptr, i32) #1
46 declare ptr @malloc(i32)
47 declare void @free(ptr)
49 attributes #0 = { returns_twice }
50 attributes #1 = { noreturn }
51 attributes #2 = { nounwind }
53 ; EH: LLVM ERROR: Emscripten EH/SjLj does not support multivalue returns
54 ; SJLJ: LLVM ERROR: Emscripten EH/SjLj does not support multivalue returns