TEST 'CodeGen/enum.c' FAILED!

This test is now failing:

******************** TEST 'CodeGen/enum.c' FAILED! ********************
  clang CodeGen/enum.c -emit-llvm | llvm-as | opt -std-compile-opts | llvm-dis | grep 'ret i32 6'

Here is the output of the test:

$ clang CodeGen/enum.c -emit-llvm | llvm-as | opt -std-compile-opts | llvm-dis
; ModuleID = '<stdin>'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i686-apple-darwin9.1.0"

define i32 @main() nounwind {
  ret i32 7

Notice that "ret i32 7" instead of "ret i32 6".

This test is now failing:

After fruitlessly hunting for a clang revision that doesn't trigger this, I finally realized that this is actually an LLVM optimizer miscompilation. With this patch, clang now passes all of its tests: