An assert is triggered when the test case program is compiled with -Oz:
Assertion failed: (!F->hasFnAttribute(llvm::Attribute::OptimizeForSize) && "OptimizeNone and OptimizeForSize on same function!"), function SetLLVMFunctionAttributesForDefinition, file /Users/ahatanaka/projects/llvm/git/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp, line 831.
This patch fixes the assert by clearing the attribute set attached to IR function foo1 and creating it again when the function's definition is parsed.