Index: clang/lib/CodeGen/CGBuiltin.cpp =================================================================== --- clang/lib/CodeGen/CGBuiltin.cpp +++ clang/lib/CodeGen/CGBuiltin.cpp @@ -101,6 +101,7 @@ // std libcall builtins are implemented. static SmallDenseMap F128Builtins{ {Builtin::BI__builtin_printf, "__printfieee128"}, + {Builtin::BI__builtin___vsnprintf_chk, "__vsnprintfieee128"}, {Builtin::BI__builtin_vsnprintf, "__vsnprintfieee128"}, {Builtin::BI__builtin_vsprintf, "__vsprintfieee128"}, {Builtin::BI__builtin_sprintf, "__sprintfieee128"}, Index: clang/test/CodeGen/PowerPC/ppc64-f128-builtins.c =================================================================== --- clang/test/CodeGen/PowerPC/ppc64-f128-builtins.c +++ clang/test/CodeGen/PowerPC/ppc64-f128-builtins.c @@ -25,6 +25,17 @@ __builtin_va_end(va); } +// IEEE128-LABEL: define dso_local void @test_vsnprintf_chk +// IEEE128: call signext i32 @__vsnprintfieee128 +// PPC128-LABEL: define dso_local void @test_vsnprintf_chk +// PPC128: call signext i32 @__vsnprintf_chk +void test_vsnprintf_chk(int n, ...) { + __builtin_va_list va; + __builtin_va_start(va, n); + __builtin___vsnprintf_chk(buf, 20, 0 , sizeof(buf), "%.Lf", va); + __builtin_va_end(va); +} + // IEEE128-LABEL: define dso_local void @test_vsprintf // IEEE128: call signext i32 @__vsprintfieee128 // PPC128-LABEL: define dso_local void @test_vsprintf