I’m using it as a template for checking if two functions @test1 and @test2 are equivalent by checking against the exhaustive possible i16 values. For this particular example it should be enough to know that for certain i16, @test1 and @test2 are not equal. When an inequality is found, the program should exit 1. However, it seems like it’s always exiting 0. Is there something I’m doing wrong?
It would help if you pasted the relevant code into your message. Paranoid people like me don’t following links in emails. 2) Have you ensured that your program doesn’t exercise undefined behavior? If your program has a signed overflow, an out-of-bounds error, or some other undefined behavior, the compiler may optimize it in surprising and unexpected way. Regards, John Criswell
I was curious about this for integers. Looks like we have at least one bug which is of a similar vein. Comment out the branch here and the test will pass on x86, otherwise it fails.
Note, command line I used was: llc int.ll -o int.s --filetype=asm && clang++ int.s -o main && ./main; echo $?