forked from OSchip/llvm-project
Add two more test cases for attribute 'noreturn'.
llvm-svn: 82841
This commit is contained in:
parent
5de279ccab
commit
9fa2eefa4c
|
@ -10,3 +10,14 @@ void test1() { // expected-warning {{function could be attribute 'noreturn'}}
|
|||
void test2() {
|
||||
if (j) while (1) { }
|
||||
}
|
||||
|
||||
// This test case illustrates that we don't warn about the missing return
|
||||
// because the function is marked noreturn and there is an infinite loop.
|
||||
extern int foo_test_3();
|
||||
__attribute__((__noreturn__)) void* test3(int arg) {
|
||||
while (1) foo_test_3();
|
||||
}
|
||||
|
||||
__attribute__((__noreturn__)) void* test3_positive(int arg) {
|
||||
while (0) foo_test_3();
|
||||
} // expected-warning{{function declared 'noreturn' should not return}}
|
||||
|
|
Loading…
Reference in New Issue