This program:
#include <stdio.h>
#include <stdlib.h>
int main() {
for (int i = 0; i < 32; ++i) {
printf("%u ", rand());
}
printf("\n");
}
prints 32 copies of the same integer value when compiled with optimization in an x86 Visual Studio 2022 17.7 Preview 1 command prompt (clang -O1 repro.c -o repro.exe). Note that this is the first VS preview to include Clang 16, specifically LLVM-16.0.1. Clang 15.0.1 included in the box with VS 2022 17.6 correctly compiles the program with and without optimization targeting either x64 or x86.