forked from OSchip/llvm-project
Don't complain about missing return statements for naked
functions. Fixes <rdar://problem/9731999>. llvm-svn: 134897
This commit is contained in:
parent
1f2aacf276
commit
9824aec830
|
@ -6457,6 +6457,10 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
|
|||
// Implements C++ [basic.start.main]p5 and C99 5.1.2.2.3.
|
||||
FD->setHasImplicitReturnZero(true);
|
||||
WP.disableCheckFallThrough();
|
||||
} else if (FD->hasAttr<NakedAttr>()) {
|
||||
// If the function is marked 'naked', don't complain about missing return
|
||||
// statements.
|
||||
WP.disableCheckFallThrough();
|
||||
}
|
||||
|
||||
// MSVC permits the use of pure specifier (=0) on function definition,
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
int a __attribute__((naked)); // expected-warning {{'naked' attribute only applies to functions}}
|
||||
|
||||
__attribute__((naked)) int t0(void) {
|
||||
__asm__ volatile("mov r0, #0");
|
||||
}
|
||||
|
||||
void t1() __attribute__((naked));
|
||||
|
||||
void t2() __attribute__((naked(2))); // expected-error {{attribute takes no arguments}}
|
||||
|
|
Loading…
Reference in New Issue