You can use C-Reduce for any language

C-Reduce, a tool created by Regehr and colleagues, helps minimize C compiler bug reproducers without the need for manual reduction. Despite the misconception that it only works for C files, C-Reduce is actually widely applicable. To use it, you need a deterministic condition, a quick reproducer, and one or more mutable source files. The tool efficiently cuts down the file size by up to 50% almost instantly, even on standard computers. By following simple steps like using the –not-c option for non-C files, C-Reduce streamlines the bug-reporting process, making it fast and simple to identify and address compiler bugs.

https://bernsteinbear.com/blog/creduce/

To top