Summary: This fixes PR20883.
Test Plan: The patch includes an automated test.
Reviewers: hansw
Differential Revision: http://reviews.llvm.org/D5256
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217413
91177308-0d34-0410-b5e6-
96231b3b80d8
if (FD && FD->hasAttr<NakedAttr>()) {
for (const Stmt *S : Body->children()) {
- if (!isa<AsmStmt>(S)) {
+ if (!isa<AsmStmt>(S) && !isa<NullStmt>(S)) {
Diag(S->getLocStart(), diag::err_non_asm_stmt_in_naked_function);
Diag(FD->getAttr<NakedAttr>()->getLocation(), diag::note_attribute);
FD->setInvalidDecl();
asm("movl x, %eax");
asm("retl");
}
+
+__attribute__((naked)) void t6() {
+ ;
+}
+
+__attribute__((naked)) void t7() {
+ asm("movl $42, %eax");
+ ;
+}