Including cstdio in a C++ that's being built into LLVM IR with the clang API

I’m trying to build the following file with clang’s frontend API, but I can’t get it working:

#include <cstdio>
int main() {}

This is my frontend API call:

#include <iostream>
#include <fstream>
#include <memory>
#include <string>
#include <llvm/IR/Module.h>
#include <clang/Basic/Diagnostic.h>
#include <clang/CodeGen/CodeGenAction.h>
#include <clang/Frontend/FrontendActions.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Basic/TargetInfo.h>
#include <clang/Frontend/TextDiagnosticPrinter.h>
#include <clang/Lex/PreprocessorOptions.h>
#include <llvm/Support/raw_ostream.h>
#include "clang/Basic/DiagnosticOptions.h"
#include <clang/Frontend/CompilerInvocation.h>
#include <llvm/Support/TargetSelect.h>

int main() {
    constexpr auto testCodeFileName = "input.cpp";

    std::ifstream t(testCodeFileName);
    const std::string testCode((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());

    llvm::InitializeAllTargetMCs();
    llvm::InitializeAllAsmPrinters();

    std::vector<const char*> args;
    args.push_back(testCodeFileName);
    args.push_back(testCodeFileName);

    clang::DiagnosticOptions DiagOpts;
    clang::TextDiagnosticPrinter* textDiagPrinter = new clang::TextDiagnosticPrinter(llvm::errs(), &DiagOpts);
    llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> pDiagIDs;
    clang::DiagnosticsEngine* pDiagnosticsEngine = new clang::DiagnosticsEngine(pDiagIDs, &DiagOpts, textDiagPrinter);
    clang::CompilerInvocation* CI = new clang::CompilerInvocation();

    CI->getLangOpts()->MicrosoftExt = true;
    CI->getLangOpts()->MSCompatibilityVersion = 1900; // For example, you can use 1900 for MSVC 2015
    CI->getLangOpts()->MSVCCompat = true;

    CI->getPreprocessorOpts().addMacroDef("_MSC_VER=1900"); // For example, you can use 1900 for MSVC 2015
    CI->getPreprocessorOpts().addMacroDef("_MSC_EXTENSIONS");

	CI->getHeaderSearchOpts().AddPath("C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include/", clang::frontend::System, false, false);

    clang::CompilerInvocation::CreateFromArgs(*CI, llvm::makeArrayRef(args), *pDiagnosticsEngine);
    llvm::StringRef testCodeData(testCode);
    std::unique_ptr<llvm::MemoryBuffer> buffer = llvm::MemoryBuffer::getMemBufferCopy(testCodeData);
    CI->getPreprocessorOpts().addRemappedFile(testCodeFileName, buffer.get());

    clang::CompilerInstance Clang;
    std::shared_ptr<clang::CompilerInvocation> CIptr(CI);
    Clang.setInvocation(CIptr);
    Clang.createDiagnostics();

    llvm::InitializeAllTargets();
    const std::shared_ptr<clang::TargetOptions> targetOptions = std::make_shared<clang::TargetOptions>();
    targetOptions->Triple = "x86_64-pc-windows-msvc";
    clang::TargetInfo* pTargetInfo = clang::TargetInfo::CreateTargetInfo(*pDiagnosticsEngine, targetOptions);
    Clang.setTarget(pTargetInfo);

    clang::CodeGenAction* compilerAction = new clang::EmitAssemblyAction();
    if(Clang.ExecuteAction(*compilerAction)) {
        if(std::unique_ptr<llvm::Module> Module = compilerAction->takeModule()) {
            Module->print(llvm::outs(), nullptr);
        }
    }

    return 0;
}

When I build and run this I get 17 errors coming from the clang call:

In file included from input.cpp:1:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\cstdio:9:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\yvals_core.h:400:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:58:
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vadefs.h:61:33: error: expected ';' after top level declarator
        typedef unsigned __int64  uintptr_t;
                                ^
In file included from input.cpp:1:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\cstdio:9:
In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\yvals_core.h:400:
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:96:1: error: a type specifier is required for all declarations
_CRT_BEGIN_C_HEADER
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:69:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
        __pragma(pack(push, _CRT_PACKING)) \
        ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:96:1: error: use of undeclared identifier 'push'
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:69:23: note: expanded from macro '_CRT_BEGIN_C_HEADER'
        __pragma(pack(push, _CRT_PACKING)) \
                      ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:96:1: error: expected ';' after top level declarator
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:70:9: note: expanded from macro '_CRT_BEGIN_C_HEADER'
        extern "C" {
        ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:193:29: error: expected ';' after top level declarator
    typedef unsigned __int64 size_t;
                            ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:228:22: error: 'short wchar_t' is invalid
    typedef unsigned short wchar_t;
                     ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:252:42: error: unknown type name 'size_t'
        template <typename _CountofType, size_t _SizeOfArray>
                                         ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:253:33: error: unknown type name '__unaligned'
        char (*__countof_helper(_UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
                                ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:240:24: note: expanded from macro '_UNALIGNED'
    #define _UNALIGNED __unaligned
                       ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:253:59: error: a type specifier is required for all declarations
        char (*__countof_helper(_UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
                                                          ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:253:44: error: declaration of '_CountofType' shadows template parameter
        char (*__countof_helper(_UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
                                           ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:252:28: note: template parameter is declared here
        template <typename _CountofType, size_t _SizeOfArray>
                           ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:368:51: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'?
        void __cdecl __security_check_cookie(_In_ uintptr_t _StackCookie);
                                                  ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:195:30: note: 'intptr_t' declared here
    typedef __int64          intptr_t;
                             ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:369:9: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
        __declspec(noreturn) void __cdecl __report_gsfailure(_In_ uintptr_t _StackCookie);
        ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:369:67: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'?
        __declspec(noreturn) void __cdecl __report_gsfailure(_In_ uintptr_t _StackCookie);
                                                                  ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:195:30: note: 'intptr_t' declared here
    typedef __int64          intptr_t;
                             ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:373:8: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'?
extern uintptr_t __security_cookie;
       ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:195:30: note: 'intptr_t' declared here
    typedef __int64          intptr_t;
                             ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:381:1: error: a type specifier is required for all declarations
_CRT_END_C_HEADER
^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:74:9: note: expanded from macro '_CRT_END_C_HEADER'
        __pragma(pack(pop))
        ^
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:381:1: error: use of undeclared identifier 'pop'
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\vcruntime.h:74:23: note: expanded from macro '_CRT_END_C_HEADER'
        __pragma(pack(pop))
                      ^
In file included from input.cpp:1:
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/include\cstdio:12:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
17 errors generated.

I’m compiling with VS 2022 on W10. Any help is very much appreciated.