aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaDecl.cpp5
-rw-r--r--test/Sema/return.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index c7a47c98c9..fa0d3cef65 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1253,6 +1253,11 @@ Sema::ControlFlowKind Sema::CheckFallThrough(Stmt *Root) {
HasFakeEdge = true;
continue;
}
+ if (isa<AsmStmt>(S)) {
+ HasFakeEdge = true;
+ HasLiveReturn = true;
+ continue;
+ }
bool NoReturnEdge = false;
if (CallExpr *C = dyn_cast<CallExpr>(S)) {
Expr *CEE = C->getCallee()->IgnoreParenCasts();
diff --git a/test/Sema/return.c b/test/Sema/return.c
index ad75cf1a0b..2e8120a754 100644
--- a/test/Sema/return.c
+++ b/test/Sema/return.c
@@ -222,3 +222,7 @@ void test32() {
void test33() {
if (j) while (1) { }
}
+
+int test34() {
+ asm("nop");
+}