diff options
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 5 | ||||
-rw-r--r-- | test/CodeGen/function-attributes.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 8f4367c858..93f4ebe945 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1787,6 +1787,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, Builder.CreateUnreachable(); Builder.ClearInsertionPoint(); + // FIXME: For now, emit a dummy basic block because expr + // emitters in generally are not ready to handle emitting + // expressions at unreachable points. + EnsureInsertPoint(); + // Return a reasonable RValue. return GetUndefRValue(RetTy); } diff --git a/test/CodeGen/function-attributes.c b/test/CodeGen/function-attributes.c index ca16459fd9..eb8b1e3324 100644 --- a/test/CodeGen/function-attributes.c +++ b/test/CodeGen/function-attributes.c @@ -35,5 +35,12 @@ void f9(void) { f9_t(); } // RUN: grep 'call i32 @f10_t() readnone' %t && int __attribute__((const)) f10_t(void); int f10(void) { return f10_t(); } +int f11(void) { + exit: + return f10_t(); +} +int f12(int arg) { + return arg ? 0 : f10_t(); +} // RUN: true |