]> granicus.if.org Git - clang/commitdiff
Tests for return statement checks
authorSeo Sanghyeon <sanxiyn@gmail.com>
Fri, 10 Oct 2008 07:20:06 +0000 (07:20 +0000)
committerSeo Sanghyeon <sanxiyn@gmail.com>
Fri, 10 Oct 2008 07:20:06 +0000 (07:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57341 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/function-return.c [new file with mode: 0644]

diff --git a/test/Sema/function-return.c b/test/Sema/function-return.c
new file mode 100644 (file)
index 0000000..8af074e
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: clang %s -fsyntax-only -verify -pedantic
+// PR2790
+
+void f1() {
+  return 0; // expected-warning {{void function 'f1' should not return a value}}
+}
+
+int f2() {
+  return; // expected-warning {{non-void function 'f2' should return a value}}
+}