aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-07-24 02:49:01 +0000
committerMike Stump <mrs@apple.com>2009-07-24 02:49:01 +0000
commit5f28a1edf6decac64ca12e51ca4a929d26fc21f2 (patch)
treea416de11de6af65f91b31a064638ecc647567735 /test
parent728d7cd2e25a0a1e5ff272163fc7ed17980f029a (diff)
Implement new warning for functions declared 'noreturn' when they fall off the end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/attributes.c4
-rw-r--r--test/Sema/attr-noreturn.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/CodeGen/attributes.c b/test/CodeGen/attributes.c
index 8f157f3d31..00252b1135 100644
--- a/test/CodeGen/attributes.c
+++ b/test/CodeGen/attributes.c
@@ -17,7 +17,7 @@
// RUN: grep '@t16 = extern_weak global i32' %t &&
void t1() __attribute__((noreturn));
-void t1() {}
+void t1() { while (1) {} }
void t2() __attribute__((nothrow));
void t2() {}
@@ -33,7 +33,7 @@ int t5 __attribute__((weak)) = 2;
int t6 __attribute__((visibility("protected")));
void t7() __attribute__((noreturn, nothrow));
-void t7() {}
+void t7() { while (1) {} }
void __t8() {}
void t9() __attribute__((weak, alias("__t8")));
diff --git a/test/Sema/attr-noreturn.c b/test/Sema/attr-noreturn.c
index d1417f093f..2970a4827e 100644
--- a/test/Sema/attr-noreturn.c
+++ b/test/Sema/attr-noreturn.c
@@ -4,7 +4,7 @@ static void (*fp0)(void) __attribute__((noreturn));
static void __attribute__((noreturn)) f0(void) {
fatal();
-}
+} // expected-error {{function declared 'noreturn' should not return}}
// On K&R
int f1() __attribute__((noreturn));