Index: include/clang/Basic/BuiltinsWebAssembly.def =================================================================== --- include/clang/Basic/BuiltinsWebAssembly.def +++ include/clang/Basic/BuiltinsWebAssembly.def @@ -36,7 +36,7 @@ BUILTIN(__builtin_wasm_max_f64, "ddd", "nc") // Exception handling builtins. -TARGET_BUILTIN(__builtin_wasm_throw, "vUiv*", "r", "exception-handling") +TARGET_BUILTIN(__builtin_wasm_throw, "vIUiv*", "r", "exception-handling") TARGET_BUILTIN(__builtin_wasm_rethrow_in_catch, "v", "r", "exception-handling") // Atomic wait and notify. Index: test/CodeGen/builtins-wasm.c =================================================================== --- test/CodeGen/builtins-wasm.c +++ test/CodeGen/builtins-wasm.c @@ -38,10 +38,10 @@ // WEBASSEMBLY64: call void @llvm.wasm.data.drop(i32 3) } -void throw(unsigned int tag, void *obj) { - return __builtin_wasm_throw(tag, obj); - // WEBASSEMBLY32: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}}) - // WEBASSEMBLY64: call void @llvm.wasm.throw(i32 %{{.*}}, i8* %{{.*}}) +void throw(void *obj) { + return __builtin_wasm_throw(0, obj); + // WEBASSEMBLY32: call void @llvm.wasm.throw(i32 0, i8* %{{.*}}) + // WEBASSEMBLY64: call void @llvm.wasm.throw(i32 0, i8* %{{.*}}) } void rethrow_in_catch(void) {