[clang] 12f78e7 - [Clang] [NFC] Fix unintended `-Wreturn-type` warnings everywhere in the test suite (#123464)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 18 10:16:37 PST 2025


Author: Sirraide
Date: 2025-01-18T19:16:33+01:00
New Revision: 12f78e740c5419f7d1fbcf8f2106e7a40cd1d6f7

URL: https://github.com/llvm/llvm-project/commit/12f78e740c5419f7d1fbcf8f2106e7a40cd1d6f7
DIFF: https://github.com/llvm/llvm-project/commit/12f78e740c5419f7d1fbcf8f2106e7a40cd1d6f7.diff

LOG: [Clang] [NFC] Fix unintended `-Wreturn-type` warnings everywhere in the test suite (#123464)

In preparation of making `-Wreturn-type` default to an error (as there
is virtually no situation where you’d *want* to fall off the end of a
function that is supposed to return a value), this patch fixes tests
that have relied on this being only a warning, of which there seem 
to be 3 kinds:

1. Tests which for no apparent reason have a function that triggers the
warning.

I suspect that a lot of these were on accident (or from before the
warning was introduced), since a lot of people will open issues w/ their
problematic code in the `main` function (which is the one case where you
don’t need to return from a non-void function, after all...), which
someone will then copy, possibly into a namespace, possibly renaming it,
the end result of that being that you end up w/ something that
definitely is not `main` anymore, but which still is declared as
returning `int`, and which still has no return statement (another reason
why I think this might apply to a lot of these is because usually the
actual return type of such problematic functions is quite literally
`int`).
  
A lot of these are really old tests that don’t use `-verify`, which is
why no-one noticed or had to care about the extra warning that was
already being emitted by them until now.

2. Tests which test either `-Wreturn-type`, `[[noreturn]]`, or what
codegen and sanitisers do whenever you do fall off the end of a
function.

3. Tests where I struggle to figure out what is even being tested
(usually because they’re Objective-C tests, and I don’t know
Objective-C), whether falling off the end of a function matters in the
first place, and tests where actually spelling out an expression to
return would be rather cumbersome (e.g. matrix types currently don’t
support list initialisation, so I can’t write e.g. `return {}`).

For tests that fall into categories 2 and 3, I just added
`-Wno-error=return-type` to the `RUN` lines and called it a day. This
was especially necessary for the former since `-Wreturn-type` is an
analysis-based warning, meaning that it is currently impossible to test
for more than one occurrence of it in the same compilation if it
defaults to an error since the analysis pass is skipped for subsequent
functions as soon as an error is emitted.

I’ve also added `-Werror=return-type` to a few tests that I had already
updated as this patch was previously already making the warning an error
by default, but we’ve decided to split that into two patches instead.

Added: 
    clang/test/SemaCXX/err-missing-noreturn-1.cpp
    clang/test/SemaCXX/err-missing-noreturn-2.cpp

Modified: 
    clang/test/ARCMT/autoreleases.m
    clang/test/ARCMT/autoreleases.m.result
    clang/test/ARCMT/retains.m
    clang/test/ARCMT/retains.m.result
    clang/test/AST/ast-dump-cxx2b-deducing-this.cpp
    clang/test/AST/ast-dump-special-member-functions.cpp
    clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
    clang/test/Analysis/const-method-call.cpp
    clang/test/Analysis/inline-unique-reports.c
    clang/test/Analysis/malloc.c
    clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
    clang/test/Analysis/novoidtypecrash.c
    clang/test/Analysis/plist-output.m
    clang/test/Analysis/plist-stats-output.c
    clang/test/Analysis/scopes-cfg-output.cpp
    clang/test/Analysis/structured_bindings.cpp
    clang/test/CXX/drs/cwg605.cpp
    clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
    clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
    clang/test/CodeGen/2003-06-26-CFECrash.c
    clang/test/CodeGen/2003-08-18-SigSetJmp.c
    clang/test/CodeGen/2003-08-23-LocalUnionTest.c
    clang/test/CodeGen/2003-10-29-AsmRename.c
    clang/test/CodeGen/2003-11-20-ComplexDivision.c
    clang/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c
    clang/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
    clang/test/CodeGen/2005-01-02-VAArgError-ICE.c
    clang/test/CodeGen/2005-06-15-ExpandGotoInternalProblem.c
    clang/test/CodeGen/2007-01-06-KNR-Proto.c
    clang/test/CodeGen/2008-05-06-CFECrash.c
    clang/test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c
    clang/test/CodeGen/2008-10-13-FrontendCrash.c
    clang/test/CodeGen/2009-01-21-InvalidIterator.c
    clang/test/CodeGen/2009-05-04-EnumInreg.c
    clang/test/CodeGen/2009-07-15-pad-wchar_t-array.c
    clang/test/CodeGen/SystemZ/vec-abi-gnuattr-05.c
    clang/test/CodeGen/X86/avx512fp16-abi.c
    clang/test/CodeGen/X86/x86_64-atomic-128.c
    clang/test/CodeGen/align-local.c
    clang/test/CodeGen/arm-cmse-nonsecure.c
    clang/test/CodeGen/arm-cmse-secure.c
    clang/test/CodeGen/attr-noinline.cpp
    clang/test/CodeGen/attr-noreturn.c
    clang/test/CodeGen/block-copy.c
    clang/test/CodeGen/builtin-memfns.c
    clang/test/CodeGen/catch-undef-behavior.c
    clang/test/CodeGen/cfi-unrelated-cast.cpp
    clang/test/CodeGen/const-label-addr.c
    clang/test/CodeGen/debug-info-crash.c
    clang/test/CodeGen/debug-info.c
    clang/test/CodeGen/empty-union-init.c
    clang/test/CodeGen/exceptions-seh.c
    clang/test/CodeGen/exprs.c
    clang/test/CodeGen/ext-int-cc.c
    clang/test/CodeGen/implicit-arg.c
    clang/test/CodeGen/msan-param-retval.c
    clang/test/CodeGen/msan-param-retval.cpp
    clang/test/CodeGen/object-size.c
    clang/test/CodeGen/sparcv8-abi.c
    clang/test/CodeGen/sret.c
    clang/test/CodeGen/static-order.c
    clang/test/CodeGen/staticinit.c
    clang/test/CodeGen/struct.c
    clang/test/CodeGen/ubsan-debuglog-return.c
    clang/test/CodeGen/union.c
    clang/test/CodeGen/ve-abi.c
    clang/test/CodeGenCXX/2007-01-06-PtrMethodInit.cpp
    clang/test/CodeGenCXX/2007-09-10-RecursiveTypeResolution.cpp
    clang/test/CodeGenCXX/2007-10-01-StructResize.cpp
    clang/test/CodeGenCXX/2009-08-11-VectorRetTy.cpp
    clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp
    clang/test/CodeGenCXX/address-space-cast-coerce.cpp
    clang/test/CodeGenCXX/array-value-initialize.cpp
    clang/test/CodeGenCXX/attr.cpp
    clang/test/CodeGenCXX/c-linkage.cpp
    clang/test/CodeGenCXX/catch-undef-behavior.cpp
    clang/test/CodeGenCXX/conditional-gnu-ext.cpp
    clang/test/CodeGenCXX/cxx1y-variable-template-linkage.cpp
    clang/test/CodeGenCXX/debug-info-cxx0x.cpp
    clang/test/CodeGenCXX/debug-info-scoped-class.cpp
    clang/test/CodeGenCXX/debug-lambda-this.cpp
    clang/test/CodeGenCXX/expr.cpp
    clang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
    clang/test/CodeGenCXX/mangle-exprs.cpp
    clang/test/CodeGenCXX/mangle-variadic-templates.cpp
    clang/test/CodeGenCXX/mangle.cpp
    clang/test/CodeGenCXX/matrix-type-operators.cpp
    clang/test/CodeGenCXX/matrix-type.cpp
    clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
    clang/test/CodeGenCXX/new-alias.cpp
    clang/test/CodeGenCXX/nrvo.cpp
    clang/test/CodeGenCXX/reference-field.cpp
    clang/test/CodeGenCXX/return.cpp
    clang/test/CodeGenCXX/template-instantiation.cpp
    clang/test/CodeGenCXX/trap-fnattr.cpp
    clang/test/CodeGenCXX/ubsan-check-debuglocs.cpp
    clang/test/CodeGenObjC/2007-10-18-ProDescriptor.m
    clang/test/CodeGenObjC/2008-11-25-Blocks.m
    clang/test/CodeGenObjC/debug-info-crash.m
    clang/test/CodeGenObjC/encode-test.m
    clang/test/CodeGenObjC/message-arrays.m
    clang/test/CodeGenObjC/metadata-symbols-32.m
    clang/test/CodeGenObjC/metadata-symbols-64.m
    clang/test/CodeGenObjC/objc2-weak-compare.m
    clang/test/CodeGenObjC/objc2-write-barrier-2.m
    clang/test/CodeGenObjC/protocols-lazy.m
    clang/test/CodeGenObjC/strong-in-c-struct.m
    clang/test/CodeGenObjCXX/debug-info-line.mm
    clang/test/CodeGenObjCXX/instantiate-return.mm
    clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm
    clang/test/CodeGenObjCXX/property-dot-reference.mm
    clang/test/CodeGenObjCXX/return.mm
    clang/test/CoverageMapping/switch.cpp
    clang/test/Driver/cc-log-diagnostics.c
    clang/test/FixIt/fixit-availability-maccatalyst.m
    clang/test/FixIt/fixit-c++11.cpp
    clang/test/Frontend/absolute-paths.c
    clang/test/Frontend/ast-codegen.c
    clang/test/Frontend/ast-main.cpp
    clang/test/Misc/serialized-diags-stable.c
    clang/test/Modules/pr61067.cppm
    clang/test/Modules/redecl-merge.m
    clang/test/PCH/irgen-rdar13114142.mm
    clang/test/PCH/late-parsed-instantiations.cpp
    clang/test/PCH/pr4489.c
    clang/test/PCH/va_arg.c
    clang/test/PCH/va_arg.h
    clang/test/Parser/promote_types_in_proto.c
    clang/test/Rewriter/rewrite-extern-c.mm
    clang/test/Sema/freemain.c
    clang/test/Sema/return-type-mismatch.c
    clang/test/SemaCXX/attr-noreturn.cpp
    clang/test/SemaCXX/constant-expression-cxx14.cpp
    clang/test/SemaCXX/constexpr-return-non-void-cxx2b.cpp
    clang/test/SemaCXX/return-noreturn.cpp
    clang/test/SemaCXX/warn-missing-noreturn.cpp
    clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-add-assign.cpp
    clang/test/SemaObjC/return-noreturn.m
    clang/test/SemaObjC/try-catch.m
    clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp
    clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
    clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
    clang/unittests/Tooling/ASTSelectionTest.cpp
    clang/unittests/Tooling/LexicallyOrderedRecursiveASTVisitorTest.cpp
    clang/unittests/Tooling/Syntax/BuildTreeTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/ARCMT/autoreleases.m b/clang/test/ARCMT/autoreleases.m
index 4c268c09a715c6..7c046dc227a068 100644
--- a/clang/test/ARCMT/autoreleases.m
+++ b/clang/test/ARCMT/autoreleases.m
@@ -69,7 +69,7 @@ id test2(A* val) {
   return val;
 }
 
-id test3(void) {
+void test3(void) {
   id a = [[A alloc] init];
   [a autorelease];
 }

diff  --git a/clang/test/ARCMT/autoreleases.m.result b/clang/test/ARCMT/autoreleases.m.result
index b3aad804a45be6..29d00ea60deed8 100644
--- a/clang/test/ARCMT/autoreleases.m.result
+++ b/clang/test/ARCMT/autoreleases.m.result
@@ -64,6 +64,6 @@ id test2(A* val) {
   return val;
 }
 
-id test3(void) {
+void test3(void) {
   id a = [[A alloc] init];
 }

diff  --git a/clang/test/ARCMT/retains.m b/clang/test/ARCMT/retains.m
index 43a94fc16cecf2..a38efe15964034 100644
--- a/clang/test/ARCMT/retains.m
+++ b/clang/test/ARCMT/retains.m
@@ -21,7 +21,7 @@ @implementation Foo
 
 @synthesize bar;
 
--(id)something {}
+-(id)something { return (id)0; }
 
 -(id)test:(id)obj {
   id x = self.bar;

diff  --git a/clang/test/ARCMT/retains.m.result b/clang/test/ARCMT/retains.m.result
index 4e720d6bb4c112..cd3bb3848fcecb 100644
--- a/clang/test/ARCMT/retains.m.result
+++ b/clang/test/ARCMT/retains.m.result
@@ -21,7 +21,7 @@ id IhaveSideEffect(void);
 
 @synthesize bar;
 
--(id)something {}
+-(id)something { return (id)0; }
 
 -(id)test:(id)obj {
   id x = self.bar;

diff  --git a/clang/test/AST/ast-dump-cxx2b-deducing-this.cpp b/clang/test/AST/ast-dump-cxx2b-deducing-this.cpp
index 1b385e0fc33319..854d12b4cdba6e 100644
--- a/clang/test/AST/ast-dump-cxx2b-deducing-this.cpp
+++ b/clang/test/AST/ast-dump-cxx2b-deducing-this.cpp
@@ -5,7 +5,7 @@ struct S {
   int f(this S&);
 };
 
-int main() {
+void main() {
   S s;
   int x = s.f();
   // CHECK: CallExpr 0x{{[^ ]*}} <col:11, col:15> 'int

diff  --git a/clang/test/AST/ast-dump-special-member-functions.cpp b/clang/test/AST/ast-dump-special-member-functions.cpp
index b98c90f6760434..0fe2cee615c826 100644
--- a/clang/test/AST/ast-dump-special-member-functions.cpp
+++ b/clang/test/AST/ast-dump-special-member-functions.cpp
@@ -253,25 +253,25 @@ struct TrivialCopyAssignment {
 struct NontrivialCopyAssignment {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialCopyAssignment definition
   // CHECK: CopyAssignment {{.*}}non_trivial{{.*}}
-  NontrivialCopyAssignment& operator=(const NontrivialCopyAssignment&) {}
+  NontrivialCopyAssignment& operator=(const NontrivialCopyAssignment&) { return *this; }
 };
 
 struct CopyAssignmentHasConstParam {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentHasConstParam definition
   // CHECK: CopyAssignment {{.*}}has_const_param{{.*}}
-  CopyAssignmentHasConstParam& operator=(const CopyAssignmentHasConstParam&) {}
+  CopyAssignmentHasConstParam& operator=(const CopyAssignmentHasConstParam&) { return *this; }
 };
 
 struct CopyAssignmentDoesNotHaveConstParam {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct CopyAssignmentDoesNotHaveConstParam definition
   // CHECK-NOT: CopyAssignment {{.*}} has_const_param{{.*}}
-  CopyAssignmentDoesNotHaveConstParam& operator=(CopyAssignmentDoesNotHaveConstParam&) {}
+  CopyAssignmentDoesNotHaveConstParam& operator=(CopyAssignmentDoesNotHaveConstParam&) { return *this; }
 };
 
 struct UserDeclaredCopyAssignment {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredCopyAssignment definition
   // CHECK: CopyAssignment {{.*}}user_declared{{.*}}
-  UserDeclaredCopyAssignment& operator=(const UserDeclaredCopyAssignment&) {}
+  UserDeclaredCopyAssignment& operator=(const UserDeclaredCopyAssignment&) { return *this; }
 };
 
 struct NonUserDeclaredCopyAssignment {
@@ -288,7 +288,7 @@ struct NeedsImplicitCopyAssignment {
 struct DoesNotNeedImplicitCopyAssignment {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitCopyAssignment definition
   // CHECK-NOT: CopyAssignment {{.*}}needs_implicit{{.*}}
-  DoesNotNeedImplicitCopyAssignment& operator=(const DoesNotNeedImplicitCopyAssignment&) {}
+  DoesNotNeedImplicitCopyAssignment& operator=(const DoesNotNeedImplicitCopyAssignment&) { return *this; }
 };
 
 struct DeclaresCopyAssignment {
@@ -352,13 +352,13 @@ struct TrivialMoveAssignment {
 struct NontrivialMoveAssignment {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct NontrivialMoveAssignment definition
   // CHECK: MoveAssignment {{.*}}non_trivial{{.*}}
-  NontrivialMoveAssignment& operator=(NontrivialMoveAssignment&&) {}
+  NontrivialMoveAssignment& operator=(NontrivialMoveAssignment&&) { return *this; }
 };
 
 struct UserDeclaredMoveAssignment {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct UserDeclaredMoveAssignment definition
   // CHECK: MoveAssignment {{.*}}user_declared{{.*}}
-  UserDeclaredMoveAssignment& operator=(UserDeclaredMoveAssignment&&) {}
+  UserDeclaredMoveAssignment& operator=(UserDeclaredMoveAssignment&&) { return *this; }
 };
 
 struct NonUserDeclaredMoveAssignment {
@@ -375,7 +375,7 @@ struct NeedsImplicitMoveAssignment {
 struct DoesNotNeedImplicitMoveAssignment {
   // CHECK: CXXRecordDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+3]]:1> line:[[@LINE-1]]:8 struct DoesNotNeedImplicitMoveAssignment definition
   // CHECK-NOT: MoveAssignment {{.*}}needs_implicit{{.*}}
-  DoesNotNeedImplicitMoveAssignment& operator=(DoesNotNeedImplicitMoveAssignment&&) {}
+  DoesNotNeedImplicitMoveAssignment& operator=(DoesNotNeedImplicitMoveAssignment&&) { return *this; }
 };
 
 struct MoveAssignmentNeedsOverloadResolution : virtual DeletedDestructor {

diff  --git a/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist b/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
index 32244329c434aa..8b8cc3239bd4bd 100644
--- a/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
+++ b/clang/test/Analysis/Inputs/expected-plists/plist-output.m.plist
@@ -6151,7 +6151,7 @@
    <key>type</key><string>Argument with 'nonnull' attribute passed null</string>
    <key>check_name</key><string>core.NonNullParamChecker</string>
    <!-- This hash is experimental and going to change! -->
-   <key>issue_hash_content_of_line_in_context</key><string>c0b359a043c633f1b8d1581f68743361</string>
+   <key>issue_hash_content_of_line_in_context</key><string>4c580a2a9cf15947fa485a0a9e625306</string>
   <key>issue_context_kind</key><string>function</string>
   <key>issue_context</key><string>RDar13295437</string>
   <key>issue_hash_function_offset</key><string>3</string>

diff  --git a/clang/test/Analysis/const-method-call.cpp b/clang/test/Analysis/const-method-call.cpp
index 7da7ca5554a23e..b37ce17447bdd2 100644
--- a/clang/test/Analysis/const-method-call.cpp
+++ b/clang/test/Analysis/const-method-call.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
+// RUN: %clang_analyze_cc1 -Wno-error=return-type -analyzer-checker=core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false %s
 
 void clang_analyzer_eval(bool);
 

diff  --git a/clang/test/Analysis/inline-unique-reports.c b/clang/test/Analysis/inline-unique-reports.c
index e58870ea74ab83..306e314a94e437 100644
--- a/clang/test/Analysis/inline-unique-reports.c
+++ b/clang/test/Analysis/inline-unique-reports.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -Wno-error=implicit-int -o %t > /dev/null 2>&1
+// RUN: %clang_analyze_cc1 %s -analyzer-checker=core.NullDereference -analyzer-output=plist -Wno-error=implicit-int -Wno-error=return-type -o %t > /dev/null 2>&1
 // RUN: %normalize_plist <%t | 
diff  -ub %S/Inputs/expected-plists/inline-unique-reports.c.plist -
 
 static inline bug(int *p) {

diff  --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c
index f2f8975b5f0e21..0dc667bc1ed505 100644
--- a/clang/test/Analysis/malloc.c
+++ b/clang/test/Analysis/malloc.c
@@ -1914,8 +1914,8 @@ variable 'buf', which is not memory allocated by 'malloc()' [unix.Malloc]}}
 
 (*crash_a)(); // expected-warning{{type specifier missing}}
 // A CallEvent without a corresponding FunctionDecl.
-crash_b() { crash_a(); } // no-crash
-// expected-warning at -1{{type specifier missing}} expected-warning at -1{{non-void}}
+crash_b() { crash_a(); return 0; } // no-crash
+// expected-warning at -1{{type specifier missing}}
 
 long *global_a;
 void realloc_crash(void) {

diff  --git a/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m b/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
index bfc3cb92b639af..300337e3b977ff 100644
--- a/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
+++ b/clang/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m
@@ -1,8 +1,8 @@
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin8 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.1 2>&1
+// RUN: %clang_analyze_cc1 -Wno-error=return-type -triple i386-apple-darwin8 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.1 2>&1
 // RUN: FileCheck -input-file=%t.1 -check-prefix=CHECK-darwin8 %s
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.2 2>&1
+// RUN: %clang_analyze_cc1 -Wno-error=return-type -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.2 2>&1
 // RUN: FileCheck -input-file=%t.2 -check-prefix=CHECK-darwin9 %s
-// RUN: %clang_analyze_cc1 -triple thumbv6-apple-ios4.0 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.3 2>&1
+// RUN: %clang_analyze_cc1 -Wno-error=return-type -triple thumbv6-apple-ios4.0 -analyzer-checker=core,alpha.core -Wno-objc-root-class %s > %t.3 2>&1
 // RUN: FileCheck -input-file=%t.3 -check-prefix=CHECK-darwin9 %s
 
 @interface MyClass {}

diff  --git a/clang/test/Analysis/novoidtypecrash.c b/clang/test/Analysis/novoidtypecrash.c
index 197516a2596187..5af30c20104386 100644
--- a/clang/test/Analysis/novoidtypecrash.c
+++ b/clang/test/Analysis/novoidtypecrash.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -std=c89 -Wno-int-conversion -analyzer-checker=core %s
+// RUN: %clang_analyze_cc1 -Wno-error=return-type -std=c89 -Wno-int-conversion -analyzer-checker=core %s
 x;
 y(void **z) { // no-crash
   *z = x;

diff  --git a/clang/test/Analysis/plist-output.m b/clang/test/Analysis/plist-output.m
index 96123243a833a0..b89aab0a7c4cfd 100644
--- a/clang/test/Analysis/plist-output.m
+++ b/clang/test/Analysis/plist-output.m
@@ -177,7 +177,7 @@ - (void)test {
 
 struct  RDar13295437_S { int *i; };
 
-int  RDar13295437(void) {
+void RDar13295437(void) {
   struct RDar13295437_S s = {0};
   struct RDar13295437_S *sp = &s;
   RDar13295437_f(sp->i);

diff  --git a/clang/test/Analysis/plist-stats-output.c b/clang/test/Analysis/plist-stats-output.c
index 4bcae557d9276d..42e0a802d3e377 100644
--- a/clang/test/Analysis/plist-stats-output.c
+++ b/clang/test/Analysis/plist-stats-output.c
@@ -2,7 +2,7 @@
 // REQUIRES: asserts
 // RUN: FileCheck --input-file=%t.plist %s
 
-int foo(void) {}
+void foo(void) {}
 
 
 // CHECK:  <key>diagnostics</key>

diff  --git a/clang/test/Analysis/scopes-cfg-output.cpp b/clang/test/Analysis/scopes-cfg-output.cpp
index 5e6706602d4564..c082bb179545fa 100644
--- a/clang/test/Analysis/scopes-cfg-output.cpp
+++ b/clang/test/Analysis/scopes-cfg-output.cpp
@@ -1074,7 +1074,7 @@ void test_switch_with_compound_with_default() {
 // CHECK-NEXT:   Succs (1): B4
 // CHECK:      [B0 (EXIT)]
 // CHECK-NEXT:   Preds (1): B1
-int test_switch_with_compound_without_default() {
+void test_switch_with_compound_without_default() {
   char c = '1';
   switch (int i = getX()) {
     case 0:

diff  --git a/clang/test/Analysis/structured_bindings.cpp b/clang/test/Analysis/structured_bindings.cpp
index 7004c2e7dcf43f..989c584189ab2d 100644
--- a/clang/test/Analysis/structured_bindings.cpp
+++ b/clang/test/Analysis/structured_bindings.cpp
@@ -3,10 +3,10 @@
 void clang_analyzer_eval(bool);
 
 struct s { int a; };
-int foo() {
+void foo() {
   auto [a] = s{1};
   clang_analyzer_eval(a == 1); // expected-warning{{TRUE}}
-} // expected-warning{{non-void function does not return a value}}
+}
 
 struct s2 {
   int &x;

diff  --git a/clang/test/CXX/drs/cwg605.cpp b/clang/test/CXX/drs/cwg605.cpp
index 2fd9e8155bf77b..b98c483f3118eb 100644
--- a/clang/test/CXX/drs/cwg605.cpp
+++ b/clang/test/CXX/drs/cwg605.cpp
@@ -12,7 +12,7 @@ template <class T>
 static T f(T t) {}
 
 template <>
-int f(int t) {}
+int f(int t) { return 0; }
 
 void g(int a) {
   f(a);

diff  --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
index 2a99ff0ea44f90..84d84a61a8d269 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -std=c++11 %s -Winvalid-noreturn -verify
+// RUN: %clang_cc1 -Werror=return-type -std=c++11 %s -Winvalid-noreturn -verify
 
 // An attribute-specifier-seq in a lambda-declarator appertains to the
 // type of the corresponding function call operator.
 void test_attributes() {
-  auto nrl = [](int x) -> int { if (x > 0) return x; }; // expected-warning{{on-void lambda does not return a value in all control paths}}
+  auto nrl = [](int x) -> int { if (x > 0) return x; }; // expected-error{{non-void lambda does not return a value in all control paths}}
 
   // FIXME: GCC accepts the [[gnu::noreturn]] attribute here.
   auto nrl2 = []() [[gnu::noreturn]] { return; }; // expected-warning{{attribute 'noreturn' ignored}}

diff  --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
index 73714f1a947a10..cb04d9567d2e4e 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
+// RUN: %clang_cc1 -Werror=return-type -fsyntax-only -std=c++11 %s -verify
 
 // Check that analysis-based warnings work in lambda bodies.
 void analysis_based_warnings() {
-  (void)[]() -> int { }; // expected-warning{{non-void lambda does not return a value}}
+  (void)[]() -> int { }; // expected-error{{non-void lambda does not return a value}}
 }
 
 // Check that we get the right types of captured variables (the

diff  --git a/clang/test/CodeGen/2003-06-26-CFECrash.c b/clang/test/CodeGen/2003-06-26-CFECrash.c
index aef3aa02534483..b92d9d8b18bf1b 100644
--- a/clang/test/CodeGen/2003-06-26-CFECrash.c
+++ b/clang/test/CodeGen/2003-06-26-CFECrash.c
@@ -13,7 +13,7 @@ typedef struct Globals {
 
 extern Uz_Globs G;
 
-int extract_or_test_files(void) {  
+void extract_or_test_files(void) {
   G.pInfo = G.info;
 }
 

diff  --git a/clang/test/CodeGen/2003-08-18-SigSetJmp.c b/clang/test/CodeGen/2003-08-18-SigSetJmp.c
index 986bcb8bd74c38..cf7abaef7eff86 100644
--- a/clang/test/CodeGen/2003-08-18-SigSetJmp.c
+++ b/clang/test/CodeGen/2003-08-18-SigSetJmp.c
@@ -5,7 +5,7 @@ typedef int sigjmp_buf[_JBLEN + 1];
 int sigsetjmp(sigjmp_buf env, int savemask);
 void bar(void);
 sigjmp_buf B;
-int foo(void) {
+void foo(void) {
   sigsetjmp(B, 1);
   bar();
 }

diff  --git a/clang/test/CodeGen/2003-08-23-LocalUnionTest.c b/clang/test/CodeGen/2003-08-23-LocalUnionTest.c
index 50b01e42587848..01b830f284f38d 100644
--- a/clang/test/CodeGen/2003-08-23-LocalUnionTest.c
+++ b/clang/test/CodeGen/2003-08-23-LocalUnionTest.c
@@ -4,7 +4,7 @@
 
 union foo { int X; };
 
-int test(union foo* F) {
+void test(union foo* F) {
   {
     union foo { float X; } A;
   }

diff  --git a/clang/test/CodeGen/2003-10-29-AsmRename.c b/clang/test/CodeGen/2003-10-29-AsmRename.c
index 746ff15dd0e319..0db2e862ae00e6 100644
--- a/clang/test/CodeGen/2003-10-29-AsmRename.c
+++ b/clang/test/CodeGen/2003-10-29-AsmRename.c
@@ -16,7 +16,7 @@ int Func64(struct bar* B) {
 }
 
 
-int test(void) {
+void test(void) {
   Func(0);    /* should be renamed to call Func64 */
   Func64(0);
 }

diff  --git a/clang/test/CodeGen/2003-11-20-ComplexDivision.c b/clang/test/CodeGen/2003-11-20-ComplexDivision.c
index 51198b81ee2e11..29873f5673dd2a 100644
--- a/clang/test/CodeGen/2003-11-20-ComplexDivision.c
+++ b/clang/test/CodeGen/2003-11-20-ComplexDivision.c
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
 
-int test(void) {
+void test(void) {
   __complex__ double C;
   double D;
   C / D;

diff  --git a/clang/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c b/clang/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c
index abf78fb0955660..5ad837ab4bcb8c 100644
--- a/clang/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c
+++ b/clang/test/CodeGen/2004-06-18-VariableLengthArrayOfStructures.c
@@ -3,7 +3,7 @@
 
 struct S { };
 
-int xxxx(int a) {
+void xxxx(int a) {
   struct S comps[a];
   comps[0];
 }

diff  --git a/clang/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c b/clang/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
index 0650c744e46c4f..b9deeb0e2bf63a 100644
--- a/clang/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
+++ b/clang/test/CodeGen/2004-11-27-StaticFunctionRedeclare.c
@@ -14,4 +14,4 @@ void bar(void) {
   int func(void);
   foo(func);
 }
-static int func(char** A, char ** B) {}
+static int func(char** A, char ** B) { return 0; }

diff  --git a/clang/test/CodeGen/2005-01-02-VAArgError-ICE.c b/clang/test/CodeGen/2005-01-02-VAArgError-ICE.c
index 39439d7c614cdc..4f9a536be52763 100644
--- a/clang/test/CodeGen/2005-01-02-VAArgError-ICE.c
+++ b/clang/test/CodeGen/2005-01-02-VAArgError-ICE.c
@@ -2,7 +2,7 @@
 // PR481
 // RUN: %clang_cc1 %s -Wno-implicit-function-declaration -emit-llvm -o /dev/null
 
-int flags(int a, int b, ...) {
+void flags(int a, int b, ...) {
         __builtin_va_list         args;
         __builtin_va_start(args,a);       // not the last named arg
         foo(args);

diff  --git a/clang/test/CodeGen/2005-06-15-ExpandGotoInternalProblem.c b/clang/test/CodeGen/2005-06-15-ExpandGotoInternalProblem.c
index 521e6986615151..597b0bd9afe954 100644
--- a/clang/test/CodeGen/2005-06-15-ExpandGotoInternalProblem.c
+++ b/clang/test/CodeGen/2005-06-15-ExpandGotoInternalProblem.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c99 %s -emit-llvm -o - | \
+// RUN: %clang_cc1 -Wno-error=return-type -std=c99 %s -emit-llvm -o - | \
 // RUN:    opt -O3 -disable-output
 // PR580
 

diff  --git a/clang/test/CodeGen/2007-01-06-KNR-Proto.c b/clang/test/CodeGen/2007-01-06-KNR-Proto.c
index d56a786fce538d..f38979b6700817 100644
--- a/clang/test/CodeGen/2007-01-06-KNR-Proto.c
+++ b/clang/test/CodeGen/2007-01-06-KNR-Proto.c
@@ -6,5 +6,6 @@ int svc_register (void (*dispatch) (int));
 int svc_register (dispatch)
      void (*dispatch) ();
 {
+  return 0;
 }
 

diff  --git a/clang/test/CodeGen/2008-05-06-CFECrash.c b/clang/test/CodeGen/2008-05-06-CFECrash.c
index 11775673a7cc78..7ca157969ac382 100644
--- a/clang/test/CodeGen/2008-05-06-CFECrash.c
+++ b/clang/test/CodeGen/2008-05-06-CFECrash.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -O2 %s -o /dev/null
+// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -O2 %s -o /dev/null
 // PR2292.
 __inline__ __attribute__ ((__pure__)) int g (void) {}
 void f (int k) { k = g (); }

diff  --git a/clang/test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c b/clang/test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c
index 70f3aaf6abfc72..910b5fdde7fc61 100644
--- a/clang/test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c
+++ b/clang/test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c
@@ -22,6 +22,6 @@ static void bar(void *db) {
 
 char s[5] = "hi";
 
-int foo(void) {
+void foo(void) {
   bar(0);
 }

diff  --git a/clang/test/CodeGen/2008-10-13-FrontendCrash.c b/clang/test/CodeGen/2008-10-13-FrontendCrash.c
index da28bd9b1b9b1d..f303224a44942b 100644
--- a/clang/test/CodeGen/2008-10-13-FrontendCrash.c
+++ b/clang/test/CodeGen/2008-10-13-FrontendCrash.c
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 %s -std=c89 -emit-llvm -o -
 // PR2797
 
-unsigned int
+void
 func_48 (signed char p_49)
 {
   signed char l_340;

diff  --git a/clang/test/CodeGen/2009-01-21-InvalidIterator.c b/clang/test/CodeGen/2009-01-21-InvalidIterator.c
index 83353da68beb1a..b16e6d2d24ac34 100644
--- a/clang/test/CodeGen/2009-01-21-InvalidIterator.c
+++ b/clang/test/CodeGen/2009-01-21-InvalidIterator.c
@@ -63,6 +63,7 @@ frame_hdr_cache[8];
 _Unwind_Ptr
 base_from_cb_data (struct unw_eh_callback_data *data)
 {
+  return 0;
 }
 
 void

diff  --git a/clang/test/CodeGen/2009-05-04-EnumInreg.c b/clang/test/CodeGen/2009-05-04-EnumInreg.c
index 0ea18b92691e09..491678647b8463 100644
--- a/clang/test/CodeGen/2009-05-04-EnumInreg.c
+++ b/clang/test/CodeGen/2009-05-04-EnumInreg.c
@@ -14,4 +14,4 @@ enum kobject_action {
 struct kobject;
 
 // CHECK: i32 inreg %action
-int kobject_uevent(struct kobject *kobj, enum kobject_action action) {}
+void kobject_uevent(struct kobject *kobj, enum kobject_action action) {}

diff  --git a/clang/test/CodeGen/2009-07-15-pad-wchar_t-array.c b/clang/test/CodeGen/2009-07-15-pad-wchar_t-array.c
index 7be237d11a4dd7..78bc0e8eb6a963 100644
--- a/clang/test/CodeGen/2009-07-15-pad-wchar_t-array.c
+++ b/clang/test/CodeGen/2009-07-15-pad-wchar_t-array.c
@@ -14,4 +14,5 @@ typedef __WCHAR_TYPE__ wchar_t;
 signed short _iodbcdm_sqlerror(void)
 {
   wchar_t _sqlState[6] = { L"\0" };
+  return 0;
 }

diff  --git a/clang/test/CodeGen/SystemZ/vec-abi-gnuattr-05.c b/clang/test/CodeGen/SystemZ/vec-abi-gnuattr-05.c
index c19fd17a9684d4..d0cc7615dd6bda 100644
--- a/clang/test/CodeGen/SystemZ/vec-abi-gnuattr-05.c
+++ b/clang/test/CodeGen/SystemZ/vec-abi-gnuattr-05.c
@@ -11,7 +11,7 @@ typedef __attribute__((vector_size(16))) int v4i32;
 v4i32 (*bar)(int);
 
 static int foo() {
-  (*bar)(0)[0];
+  return (*bar)(0)[0];
 }
 
 int fun() { return foo(); }

diff  --git a/clang/test/CodeGen/X86/avx512fp16-abi.c b/clang/test/CodeGen/X86/avx512fp16-abi.c
index 3d1b713a610a53..1856f1e22715c8 100644
--- a/clang/test/CodeGen/X86/avx512fp16-abi.c
+++ b/clang/test/CodeGen/X86/avx512fp16-abi.c
@@ -206,6 +206,8 @@ struct fsd {
 
 struct fsd pr52011(void) {
   // CHECK: define{{.*}} { float, double } @
+  struct fsd x;
+  return x;
 }
 
 struct hsd {
@@ -216,6 +218,8 @@ struct hsd {
 
 struct hsd pr52011_2(void) {
   // CHECK: define{{.*}} { half, double } @
+  struct hsd x;
+  return x;
 }
 
 struct hsf {
@@ -226,6 +230,8 @@ struct hsf {
 
 struct hsf pr52011_3(void) {
   // CHECK: define{{.*}} <4 x half> @
+  struct hsf x;
+  return x;
 }
 
 struct fds {
@@ -237,4 +243,6 @@ struct fds {
 struct fds pr52011_4(void) {
   // CHECK-C: define{{.*}} { float, double } @pr52011_4
   // CHECK-CPP: define{{.*}} void @_Z9pr52011_4v({{.*}} sret
+  struct fds x;
+  return x;
 }

diff  --git a/clang/test/CodeGen/X86/x86_64-atomic-128.c b/clang/test/CodeGen/X86/x86_64-atomic-128.c
index f682ffc75f8259..bf050788fa87ac 100644
--- a/clang/test/CodeGen/X86/x86_64-atomic-128.c
+++ b/clang/test/CodeGen/X86/x86_64-atomic-128.c
@@ -26,4 +26,5 @@ __int128 test_expression(_Atomic __int128 *addr) {
   // CHECK-LABEL: @test_expression
   // CHECK: atomicrmw and ptr {{.*}} seq_cst, align 16
   *addr &= 1;
+  return 0;
 }

diff  --git a/clang/test/CodeGen/align-local.c b/clang/test/CodeGen/align-local.c
index 9e8a56066e1a06..a88dd1637a7422 100644
--- a/clang/test/CodeGen/align-local.c
+++ b/clang/test/CodeGen/align-local.c
@@ -4,7 +4,7 @@ typedef struct __attribute((aligned(16))) {int x[4];} ff;
 
 // CHECK: alloca %struct.ff, align 16
 // CHECK: alloca %struct.anon, align 16
-int a(void) {
+void a(void) {
   ff a;
   struct {int x[4];} b __attribute((aligned(16)));
 }

diff  --git a/clang/test/CodeGen/arm-cmse-nonsecure.c b/clang/test/CodeGen/arm-cmse-nonsecure.c
index 3310f0cbd0e9b2..42221ac775cd86 100644
--- a/clang/test/CodeGen/arm-cmse-nonsecure.c
+++ b/clang/test/CodeGen/arm-cmse-nonsecure.c
@@ -41,8 +41,8 @@ typedef struct {
     int x, y, z;
 } Point;
 
-void *test_pointed_object(void *p) {
-// CHECK: define {{.*}} ptr @test_pointed_object
+void test_pointed_object(void *p) {
+// CHECK: define {{.*}} void @test_pointed_object
   Point *pt = (Point *)p;
   cmse_check_pointed_object(pt, CMSE_MPU_READ);
 // CHECK: call i32 @llvm.arm.cmse.tt

diff  --git a/clang/test/CodeGen/arm-cmse-secure.c b/clang/test/CodeGen/arm-cmse-secure.c
index 132172b6c8702e..305d25ad7388c5 100644
--- a/clang/test/CodeGen/arm-cmse-secure.c
+++ b/clang/test/CodeGen/arm-cmse-secure.c
@@ -53,8 +53,8 @@ typedef struct {
   int x, y, z;
 } Point;
 
-void *test_pointed_object(void *p) {
-// CHECK: define {{.*}} ptr @test_pointed_object
+void test_pointed_object(void *p) {
+// CHECK: define {{.*}} void @test_pointed_object
   Point *pt = (Point *)p;
   cmse_check_pointed_object(pt, CMSE_NONSECURE
                               | CMSE_MPU_READ

diff  --git a/clang/test/CodeGen/attr-noinline.cpp b/clang/test/CodeGen/attr-noinline.cpp
index c1fb9941b5251d..69916be3195358 100644
--- a/clang/test/CodeGen/attr-noinline.cpp
+++ b/clang/test/CodeGen/attr-noinline.cpp
@@ -8,7 +8,7 @@ static int baz(int x) {
     return x * 10;
 }
 
-[[clang::noinline]] bool noi() { }
+[[clang::noinline]] bool noi() { return true; }
 [[msvc::noinline]] bool ms_noi() { return true; }
 
 void foo(int i) {

diff  --git a/clang/test/CodeGen/attr-noreturn.c b/clang/test/CodeGen/attr-noreturn.c
index 93816b7570e876..c3f41d8424bed6 100644
--- a/clang/test/CodeGen/attr-noreturn.c
+++ b/clang/test/CodeGen/attr-noreturn.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm -std=c2x %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-CXX
+// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -std=c2x %s -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple %itanium_abi_triple -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK-CXX
 
 typedef void (*fptrs_t[4])(void);
 fptrs_t p __attribute__((noreturn));

diff  --git a/clang/test/CodeGen/block-copy.c b/clang/test/CodeGen/block-copy.c
index 4679fe19b78f8b..69881264c932f7 100644
--- a/clang/test/CodeGen/block-copy.c
+++ b/clang/test/CodeGen/block-copy.c
@@ -6,7 +6,7 @@
 
 void foo(float *);
 
-float bar(void) {
+void bar(void) {
   float lookupTable[] = {-1,-1,-1,0, -1,-1,0,-1, -1,-1,0,1, -1,-1,1,0,
 			 -1,0,-1,-1, -1,0,-1,1, -1,0,1,-1, -1,0,1,1,
 			 -1,1,-1,0, -1,1,0,-1, -1,1,0,1, -1,1,1,0,

diff  --git a/clang/test/CodeGen/builtin-memfns.c b/clang/test/CodeGen/builtin-memfns.c
index 581eb85eb28e69..40e287c065177e 100644
--- a/clang/test/CodeGen/builtin-memfns.c
+++ b/clang/test/CodeGen/builtin-memfns.c
@@ -56,7 +56,7 @@ int test6(char *X) {
 
 // CHECK: @test7
 // PR12094
-int test7(int *p) {
+void test7(int *p) {
   struct snd_pcm_hw_params_t* hwparams;  // incomplete type.
   
   // CHECK: call void @llvm.memset{{.*}} align 4 {{.*}}256, i1 false)

diff  --git a/clang/test/CodeGen/catch-undef-behavior.c b/clang/test/CodeGen/catch-undef-behavior.c
index 7580290b0b0333..14cb7705c3783e 100644
--- a/clang/test/CodeGen/catch-undef-behavior.c
+++ b/clang/test/CodeGen/catch-undef-behavior.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsanitize=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize-recover=alignment,null,object-size,shift-base,shift-exponent,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-COMMON --check-prefix=CHECK-UBSAN
-// RUN: %clang_cc1 -fsanitize-trap=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize-recover=alignment,null,object-size,shift-base,shift-exponent,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize-recover=alignment,null,object-size,shift-base,shift-exponent,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-COMMON --check-prefix=CHECK-TRAP
-// RUN: %clang_cc1 -fsanitize=signed-integer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-OVERFLOW
+// RUN: %clang_cc1 -Wno-error=return-type -fsanitize=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize-recover=alignment,null,object-size,shift-base,shift-exponent,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-COMMON --check-prefix=CHECK-UBSAN
+// RUN: %clang_cc1 -Wno-error=return-type -fsanitize-trap=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize-recover=alignment,null,object-size,shift-base,shift-exponent,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize=alignment,null,object-size,shift-base,shift-exponent,return,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -fsanitize-recover=alignment,null,object-size,shift-base,shift-exponent,signed-integer-overflow,vla-bound,float-cast-overflow,integer-divide-by-zero,bool,returns-nonnull-attribute,nonnull-attribute -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-COMMON --check-prefix=CHECK-TRAP
+// RUN: %clang_cc1 -Wno-error=return-type -fsanitize=signed-integer-overflow -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-OVERFLOW
 
 // CHECK-UBSAN: @[[INT:.*]] = private unnamed_addr constant { i16, i16, [6 x i8] } { i16 0, i16 11, [6 x i8] c"'int'\00" }
 

diff  --git a/clang/test/CodeGen/cfi-unrelated-cast.cpp b/clang/test/CodeGen/cfi-unrelated-cast.cpp
index abd67901f00202..4095d67450d37f 100644
--- a/clang/test/CodeGen/cfi-unrelated-cast.cpp
+++ b/clang/test/CodeGen/cfi-unrelated-cast.cpp
@@ -29,7 +29,7 @@ class C1 {
   virtual void f() {}
 };
 
-C1 *f1() {
+void f1() {
   myalloc<C1> allocator;
   (void)allocator.allocate(16);
   (void)allocator.allocate(16, 0);

diff  --git a/clang/test/CodeGen/const-label-addr.c b/clang/test/CodeGen/const-label-addr.c
index edfff0f8f63990..8030f96cb8aed7 100644
--- a/clang/test/CodeGen/const-label-addr.c
+++ b/clang/test/CodeGen/const-label-addr.c
@@ -2,7 +2,7 @@
 // REQUIRES: asserts
 
 // CHECK: @a.a = internal global ptr blockaddress(@a, %A)
-int a(void) {
+void a(void) {
 A:;static void* a = &&A;
 }
 

diff  --git a/clang/test/CodeGen/debug-info-crash.c b/clang/test/CodeGen/debug-info-crash.c
index b53dbc50676d40..e3a8f81d3508b4 100644
--- a/clang/test/CodeGen/debug-info-crash.c
+++ b/clang/test/CodeGen/debug-info-crash.c
@@ -6,7 +6,7 @@ __attribute__((visibility("default")))
 extern struct dispatch_queue_s _dispatch_main_q;
 typedef struct dispatch_item_s *dispatch_item_t;
 typedef void (^dispatch_legacy_block_t)(dispatch_item_t);
-dispatch_item_t LEGACY_dispatch_call(dispatch_queue_t dq,
+void LEGACY_dispatch_call(dispatch_queue_t dq,
                                      dispatch_legacy_block_t dispatch_block,
                                      dispatch_legacy_block_t callback_block) {
   dispatch_queue_t lq = _dispatch_queue_get_current() ?: (&_dispatch_main_q);

diff  --git a/clang/test/CodeGen/debug-info.c b/clang/test/CodeGen/debug-info.c
index 4c444515757bde..024e9579843d4c 100644
--- a/clang/test/CodeGen/debug-info.c
+++ b/clang/test/CodeGen/debug-info.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s
-// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-unk-unk -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple powerpc64-ibm-aix-xcoff -o - -emit-llvm -debug-info-kind=limited %s | FileCheck %s
 
 // PR3023
 void convert(void) {

diff  --git a/clang/test/CodeGen/empty-union-init.c b/clang/test/CodeGen/empty-union-init.c
index f1cdfb12f62460..386aeb260fae53 100644
--- a/clang/test/CodeGen/empty-union-init.c
+++ b/clang/test/CodeGen/empty-union-init.c
@@ -8,6 +8,7 @@ struct Mem {
 
 struct Mem *columnMem(void){
         static const struct Mem nullMem = { {} };
+        return 0;
 }
 
 

diff  --git a/clang/test/CodeGen/exceptions-seh.c b/clang/test/CodeGen/exceptions-seh.c
index a102afb1d271c4..25d622419b09c3 100644
--- a/clang/test/CodeGen/exceptions-seh.c
+++ b/clang/test/CodeGen/exceptions-seh.c
@@ -276,6 +276,7 @@ int exception_code_in_except(void) {
   } __except(1) {
     return _exception_code();
   }
+  return 0;
 }
 
 // CHECK-LABEL: define dso_local i32 @exception_code_in_except()

diff  --git a/clang/test/CodeGen/exprs.c b/clang/test/CodeGen/exprs.c
index 13a64f02710657..5cca9722dcb3a5 100644
--- a/clang/test/CodeGen/exprs.c
+++ b/clang/test/CodeGen/exprs.c
@@ -7,7 +7,7 @@ int x=sizeof(zxcv);
 int y=__alignof__(zxcv);
 
 
-void *test(int *i) {
+void test(int *i) {
  short a = 1;
  i += a;
  i + a;
@@ -18,7 +18,7 @@ _Bool test2b;
 int test2(void) { if (test2b); return 0; }
 
 // PR1921
-int test3(void) {
+void test3(void) {
   const unsigned char *bp;
   bp -= (short)1;
 }

diff  --git a/clang/test/CodeGen/ext-int-cc.c b/clang/test/CodeGen/ext-int-cc.c
index 05b2bf1bec81ee..14efd54e24ffb2 100644
--- a/clang/test/CodeGen/ext-int-cc.c
+++ b/clang/test/CodeGen/ext-int-cc.c
@@ -162,7 +162,7 @@ void ParamPassing4(_BitInt(129) a) {}
 // LA32-NOT: define{{.*}} void @ParamPassing4(ptr %{{.+}})
 #endif
 
-_BitInt(63) ReturnPassing(void){}
+_BitInt(63) ReturnPassing(void) { return 0; }
 // LIN64: define{{.*}} i64 @ReturnPassing(
 // WIN64: define dso_local i63 @ReturnPassing(
 // LIN32: define{{.*}} i63 @ReturnPassing(
@@ -193,7 +193,7 @@ _BitInt(63) ReturnPassing(void){}
 // LA64: define{{.*}} signext i63 @ReturnPassing(
 // LA32: define{{.*}} i63 @ReturnPassing(
 
-_BitInt(64) ReturnPassing2(void){}
+_BitInt(64) ReturnPassing2(void) { return 0; }
 // LIN64: define{{.*}} i64 @ReturnPassing2(
 // WIN64: define dso_local i64 @ReturnPassing2(
 // LIN32: define{{.*}} i64 @ReturnPassing2(
@@ -224,7 +224,7 @@ _BitInt(64) ReturnPassing2(void){}
 // LA64: define{{.*}} i64 @ReturnPassing2(
 // LA32: define{{.*}} i64 @ReturnPassing2(
 
-_BitInt(127) ReturnPassing3(void){}
+_BitInt(127) ReturnPassing3(void) { return 0; }
 // LIN64: define{{.*}} { i64, i64 } @ReturnPassing3(
 // WIN64: define dso_local void @ReturnPassing3(ptr dead_on_unwind noalias writable sret
 // LIN32: define{{.*}} void @ReturnPassing3(ptr dead_on_unwind noalias writable sret
@@ -257,7 +257,7 @@ _BitInt(127) ReturnPassing3(void){}
 // LA64: define{{.*}} i127 @ReturnPassing3(
 // LA32: define{{.*}} void @ReturnPassing3(ptr dead_on_unwind noalias writable sret
 
-_BitInt(128) ReturnPassing4(void){}
+_BitInt(128) ReturnPassing4(void) { return 0; }
 // LIN64: define{{.*}} { i64, i64 } @ReturnPassing4(
 // WIN64: define dso_local void @ReturnPassing4(ptr dead_on_unwind noalias writable sret
 // LIN32: define{{.*}} void @ReturnPassing4(ptr dead_on_unwind noalias writable sret
@@ -289,7 +289,7 @@ _BitInt(128) ReturnPassing4(void){}
 // LA32: define{{.*}} void @ReturnPassing4(ptr dead_on_unwind noalias writable sret
 
 #if __BITINT_MAXWIDTH__ > 128
-_BitInt(129) ReturnPassing5(void){}
+_BitInt(129) ReturnPassing5(void) { return 0; }
 // LIN64: define{{.*}} void @ReturnPassing5(ptr dead_on_unwind noalias writable sret
 // WIN64: define dso_local void @ReturnPassing5(ptr dead_on_unwind noalias writable sret
 // LIN32: define{{.*}} void @ReturnPassing5(ptr dead_on_unwind noalias writable sret
@@ -322,8 +322,8 @@ _BitInt(129) ReturnPassing5(void){}
 
 // SparcV9 is odd in that it has a return-size limit of 256, not 128 or 64
 // like other platforms, so test to make sure this behavior will still work.
-_BitInt(256) ReturnPassing6(void) {}
+_BitInt(256) ReturnPassing6(void) { return 0; }
 // SPARCV9-NOT: define{{.*}} i256 @ReturnPassing6(
-_BitInt(257) ReturnPassing7(void) {}
+_BitInt(257) ReturnPassing7(void) { return 0; }
 // SPARCV9-NOT: define{{.*}} void @ReturnPassing7(ptr dead_on_unwind noalias writable sret
 #endif

diff  --git a/clang/test/CodeGen/implicit-arg.c b/clang/test/CodeGen/implicit-arg.c
index 9959419f9b7c88..3630fbbbdb1a62 100644
--- a/clang/test/CodeGen/implicit-arg.c
+++ b/clang/test/CodeGen/implicit-arg.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -emit-llvm     -o -
-// RUN: %clang_cc1 %s -emit-llvm -O1 -o -
+// RUN: %clang_cc1 %s -Wno-error=return-type -emit-llvm     -o -
+// RUN: %clang_cc1 %s -Wno-error=return-type -emit-llvm -O1 -o -
 
 static int bar();
 void foo() {

diff  --git a/clang/test/CodeGen/msan-param-retval.c b/clang/test/CodeGen/msan-param-retval.c
index 269a759fac10e7..439ae98799c68a 100644
--- a/clang/test/CodeGen/msan-param-retval.c
+++ b/clang/test/CodeGen/msan-param-retval.c
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=CLEAN,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -fno-sanitize-memory-param-retval -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -fno-sanitize-memory-param-retval -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=NOUNDEF,NOUNDEF_ONLY,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -mllvm -msan-eager-checks -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -mllvm -msan-eager-checks -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=NOUNDEF,EAGER,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -fsanitize-memory-param-retval -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -fsanitize-memory-param-retval -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=CLEAN,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=NOUNDEF,EAGER,CHECK
 
 void bar(int x) {

diff  --git a/clang/test/CodeGen/msan-param-retval.cpp b/clang/test/CodeGen/msan-param-retval.cpp
index c4960a4702f6cd..caebb38fa50ceb 100644
--- a/clang/test/CodeGen/msan-param-retval.cpp
+++ b/clang/test/CodeGen/msan-param-retval.cpp
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=CLEAN,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -fno-sanitize-memory-param-retval -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -fno-sanitize-memory-param-retval -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=NOUNDEF,NOUNDEF_ONLY,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -mllvm -msan-eager-checks -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -mllvm -msan-eager-checks -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=NOUNDEF,EAGER,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -fsanitize-memory-param-retval -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -no-enable-noundef-analysis -fsanitize-memory-param-retval -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=CLEAN,CHECK
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -o - %s | \
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-linux-gnu -emit-llvm -fsanitize=memory -o - %s | \
 // RUN:     FileCheck %s --check-prefixes=NOUNDEF,EAGER,CHECK
 
 void bar(int x) {

diff  --git a/clang/test/CodeGen/object-size.c b/clang/test/CodeGen/object-size.c
index 58561a5470f72c..2a3dfc8f4b12b2 100644
--- a/clang/test/CodeGen/object-size.c
+++ b/clang/test/CodeGen/object-size.c
@@ -592,7 +592,7 @@ void PR30346(void) {
 
 extern char incomplete_char_array[];
 // CHECK-LABEL: @incomplete_and_function_types
-int incomplete_and_function_types(void) {
+void incomplete_and_function_types(void) {
   // CHECK: call i64 @llvm.objectsize.i64.p0
   gi = OBJECT_SIZE_BUILTIN(incomplete_char_array, 0);
   // CHECK: call i64 @llvm.objectsize.i64.p0

diff  --git a/clang/test/CodeGen/sparcv8-abi.c b/clang/test/CodeGen/sparcv8-abi.c
index 7a937176432786..c5faf130890f89 100644
--- a/clang/test/CodeGen/sparcv8-abi.c
+++ b/clang/test/CodeGen/sparcv8-abi.c
@@ -4,16 +4,19 @@
 float __complex__
 p (float __complex__  a, float __complex__  b)
 {
+  return 0;
 }
 
 // CHECK-LABEL: define{{.*}} { double, double } @q(ptr noundef byval({ double, double }) align 8 %a, ptr noundef byval({ double, double }) align 8 %b) #0 {
 double __complex__
 q (double __complex__  a, double __complex__  b)
 {
+  return 0;
 }
 
 // CHECK-LABEL: define{{.*}} { i64, i64 } @r(ptr noundef byval({ i64, i64 }) align 8 %a, ptr noundef byval({ i64, i64 }) align 8 %b) #0 {
 long long __complex__
 r (long long __complex__  a, long long __complex__  b)
 {
+  return 0;
 }

diff  --git a/clang/test/CodeGen/sret.c b/clang/test/CodeGen/sret.c
index 6d905e89b2c6fd..83dce80aa279b4 100644
--- a/clang/test/CodeGen/sret.c
+++ b/clang/test/CodeGen/sret.c
@@ -12,7 +12,7 @@ struct abc foo1(void);
 // CHECK-DAG: declare {{.*}} @foo1(ptr dead_on_unwind writable sret(%struct.abc)
 struct abc foo2();
 // CHECK-DAG: declare {{.*}} @foo2(ptr dead_on_unwind writable sret(%struct.abc)
-struct abc foo3(void){}
+struct abc foo3(void) { return (struct abc){0}; }
 // CHECK-DAG: define {{.*}} @foo3(ptr dead_on_unwind noalias writable sret(%struct.abc)
 
 void bar(void) {

diff  --git a/clang/test/CodeGen/static-order.c b/clang/test/CodeGen/static-order.c
index dbd22db96b52c0..e128c2f74245fd 100644
--- a/clang/test/CodeGen/static-order.c
+++ b/clang/test/CodeGen/static-order.c
@@ -19,4 +19,5 @@ void *f(void)
 {
   if (a.a)
     return v;
+  return 0;
 }

diff  --git a/clang/test/CodeGen/staticinit.c b/clang/test/CodeGen/staticinit.c
index 90b8fa5edb024f..ec9b5b34d3ade2 100644
--- a/clang/test/CodeGen/staticinit.c
+++ b/clang/test/CodeGen/staticinit.c
@@ -27,7 +27,7 @@ void foo(void) {
 }
 
 // CHECK: @f1.l0 = internal global i32 ptrtoint (ptr @f1 to i32)
-int f1(void) { static int l0 = (unsigned) f1; }
+void f1(void) { static int l0 = (unsigned) f1; }
 
 // PR7044
 char *f2(char key) {

diff  --git a/clang/test/CodeGen/struct.c b/clang/test/CodeGen/struct.c
index c98357160addf1..0da9b748ea3b8d 100644
--- a/clang/test/CodeGen/struct.c
+++ b/clang/test/CodeGen/struct.c
@@ -136,7 +136,7 @@ struct a14 { short a; int b; } x = {1, 1};
 
 /* flexible array members */
 struct a15 {char a; int b[];} c15;
-int a16(void) {c15.a = 1;}
+void a16(void) {c15.a = 1;}
 
 /* compound literals */
 void f13(void) {

diff  --git a/clang/test/CodeGen/ubsan-debuglog-return.c b/clang/test/CodeGen/ubsan-debuglog-return.c
index ecbebc34d22332..0a96465d330e32 100644
--- a/clang/test/CodeGen/ubsan-debuglog-return.c
+++ b/clang/test/CodeGen/ubsan-debuglog-return.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -x c -debug-info-kind=line-tables-only -emit-llvm -fsanitize=returns-nonnull-attribute -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -x c -debug-info-kind=line-tables-only -emit-llvm -fsanitize=returns-nonnull-attribute -o - %s | FileCheck %s
 // The UBSAN function call in the epilogue needs to have a debug location.
 
 __attribute__((returns_nonnull)) void *allocate(void) {}

diff  --git a/clang/test/CodeGen/union.c b/clang/test/CodeGen/union.c
index 60e9e2d771ff19..fb47d7140bed1c 100644
--- a/clang/test/CodeGen/union.c
+++ b/clang/test/CodeGen/union.c
@@ -34,7 +34,7 @@ void fS65(void) { enum E9 e = s65.a; }
 typedef union{
   unsigned char x[65536];
 } q;
-int qfunc(void) {q buf; unsigned char* x = buf.x;}
+void qfunc(void) {q buf; unsigned char* x = buf.x;}
 
 union RR {_Bool a : 1;} RRU;
 int RRF(void) {return RRU.a;}

diff  --git a/clang/test/CodeGen/ve-abi.c b/clang/test/CodeGen/ve-abi.c
index 25ec3ed07b7dd5..4e73b7eec16c12 100644
--- a/clang/test/CodeGen/ve-abi.c
+++ b/clang/test/CodeGen/ve-abi.c
@@ -52,6 +52,7 @@ unsigned long fun_zi64(unsigned long a, unsigned long b) {
 
 // CHECK-LABEL: define{{.*}} i128 @fun_si128(i128 noundef %a, i128 noundef %b) #0 {
 __int128 fun_si128(__int128 a, __int128 b) {
+  return a;
 }
 
 // CHECK-LABEL: define{{.*}} i128 @fun_zi128(i128 noundef %a, i128 noundef %b) #0 {

diff  --git a/clang/test/CodeGenCXX/2007-01-06-PtrMethodInit.cpp b/clang/test/CodeGenCXX/2007-01-06-PtrMethodInit.cpp
index 37005c5e9df77f..465f55f9f8ecfe 100644
--- a/clang/test/CodeGenCXX/2007-01-06-PtrMethodInit.cpp
+++ b/clang/test/CodeGenCXX/2007-01-06-PtrMethodInit.cpp
@@ -20,6 +20,8 @@ extern "C++"
   {
     static const nsIID & GetIID ()
     {
+      static const nsIID i = {};
+      return i;
     }
   };
 }
@@ -31,6 +33,8 @@ class nsIDOMEventListener:public nsISupports
 {
 public:static const nsIID & GetIID ()
   {
+    static const nsIID i = {};
+    return i;
   }
   virtual nsresult
     __attribute__ ((regparm (0), cdecl)) HandleEvent (nsIDOMEvent * event) =
@@ -42,6 +46,7 @@ public:static const nsIID & GetIID ()
   {
     static const nsIID iid = {
     };
+    return iid;
   }
   virtual nsresult
     __attribute__ ((regparm (0),

diff  --git a/clang/test/CodeGenCXX/2007-09-10-RecursiveTypeResolution.cpp b/clang/test/CodeGenCXX/2007-09-10-RecursiveTypeResolution.cpp
index ec8a516c696b10..b8d55ced2c2a63 100644
--- a/clang/test/CodeGenCXX/2007-09-10-RecursiveTypeResolution.cpp
+++ b/clang/test/CodeGenCXX/2007-09-10-RecursiveTypeResolution.cpp
@@ -55,6 +55,7 @@ namespace Manta
       vector < _Tp, _Alloc > > iterator;
     iterator end ()
     {
+      return {};
     }
   };
   class MantaInterface

diff  --git a/clang/test/CodeGenCXX/2007-10-01-StructResize.cpp b/clang/test/CodeGenCXX/2007-10-01-StructResize.cpp
index 8e5750d3c4ef48..ce1886c2e5032d 100644
--- a/clang/test/CodeGenCXX/2007-10-01-StructResize.cpp
+++ b/clang/test/CodeGenCXX/2007-10-01-StructResize.cpp
@@ -7,7 +7,7 @@ struct Bork {
   unsigned int f2 : 30;
 };
 
-int Foo(Bork *hdr) {
+void Foo(Bork *hdr) {
   hdr->f1 = 7;
   hdr->f2 = 927;
 }

diff  --git a/clang/test/CodeGenCXX/2009-08-11-VectorRetTy.cpp b/clang/test/CodeGenCXX/2009-08-11-VectorRetTy.cpp
index fe6f32a6969cd8..04b1067aabdec6 100644
--- a/clang/test/CodeGenCXX/2009-08-11-VectorRetTy.cpp
+++ b/clang/test/CodeGenCXX/2009-08-11-VectorRetTy.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 %s -emit-llvm -o /dev/null
 typedef void (*Func) ();
 typedef long long m64 __attribute__((__vector_size__(8), __may_alias__));
-static inline m64 __attribute__((__always_inline__, __nodebug__)) _mm_set1_pi16() {}
+static inline m64 __attribute__((__always_inline__, __nodebug__)) _mm_set1_pi16() { return {}; }
 template <class MM>
 static void Bork() {
   const m64 mmx_0x00ff = _mm_set1_pi16();

diff  --git a/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp b/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp
index a88d605f565eed..ef589e0537974d 100644
--- a/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp
+++ b/clang/test/CodeGenCXX/2010-07-23-DeclLoc.cpp
@@ -16,7 +16,7 @@ namespace std {
   public:
     typedef _Tp element_type;
     auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) {    }
-    element_type&     operator*() const throw()     {    }
+    element_type&     operator*() const throw()     { return *_M_ptr; }
   };
 }
 class Pointer32 {
@@ -69,17 +69,17 @@ template <typename SIZE_AND_ENDIANNESS> void extract_dwarf_data_from_header(TExt
                                                                             TRawSymbolOwnerData<typename SIZE_AND_ENDIANNESS::SIZE>& symbol_owner_data,
                                                                             TAddressRelocator<typename SIZE_AND_ENDIANNESS::SIZE>* address_relocator) {}
 struct CSCppSymbolOwnerHashFunctor {
-  size_t operator()(const CSCppSymbolOwner& symbol_owner) const {
+  void operator()(const CSCppSymbolOwner& symbol_owner) const {
 # 97 "wrong_place_for_decl.cpp"
   }
 };
-template <typename SIZE_AND_ENDIANNESS> CSCppSymbolOwnerData* create_symbol_owner_data_arch_specific(CSCppSymbolOwner* symbol_owner, const char* dsym_path) {
+template <typename SIZE_AND_ENDIANNESS> void create_symbol_owner_data_arch_specific(CSCppSymbolOwner* symbol_owner, const char* dsym_path) {
   typedef typename SIZE_AND_ENDIANNESS::SIZE SIZE;
   std::auto_ptr< TRawSymbolOwnerData<SIZE> > data(new TRawSymbolOwnerData<SIZE>());
   std::auto_ptr< TExtendedMachOHeader<SIZE_AND_ENDIANNESS> > header;
   extract_dwarf_data_from_header(*header, *data, (TAddressRelocator<typename SIZE_AND_ENDIANNESS::SIZE>*)__null);
 }
-CSCppSymbolOwnerData* create_symbol_owner_data2(CSCppSymbolOwner* symbol_owner, const char* dsym_path) {
+void create_symbol_owner_data2(CSCppSymbolOwner* symbol_owner, const char* dsym_path) {
   create_symbol_owner_data_arch_specific< ISA32Little >(symbol_owner, dsym_path);
   create_symbol_owner_data_arch_specific< ISA32Big >(symbol_owner, dsym_path);
   create_symbol_owner_data_arch_specific< ISA64Little >(symbol_owner, dsym_path);

diff  --git a/clang/test/CodeGenCXX/address-space-cast-coerce.cpp b/clang/test/CodeGenCXX/address-space-cast-coerce.cpp
index 1ad46042b6efd6..ed575e14244f5f 100644
--- a/clang/test/CodeGenCXX/address-space-cast-coerce.cpp
+++ b/clang/test/CodeGenCXX/address-space-cast-coerce.cpp
@@ -41,7 +41,7 @@ template<typename T, unsigned int n>
 
 using char1 = my_vector_type<char, 1>;
 
-int mane() {
+void mane() {
 
     char1 f1{1};
     char1 f2{1};

diff  --git a/clang/test/CodeGenCXX/array-value-initialize.cpp b/clang/test/CodeGenCXX/array-value-initialize.cpp
index 27607c1c754453..b3dc24871b495a 100644
--- a/clang/test/CodeGenCXX/array-value-initialize.cpp
+++ b/clang/test/CodeGenCXX/array-value-initialize.cpp
@@ -22,7 +22,7 @@ struct Foo {
         S sbar_[5];
 };
 
-int test1(void) {
+void test1(void) {
         Foo a;
 }
 

diff  --git a/clang/test/CodeGenCXX/attr.cpp b/clang/test/CodeGenCXX/attr.cpp
index 3890f2018c9a62..78df87c6e08881 100644
--- a/clang/test/CodeGenCXX/attr.cpp
+++ b/clang/test/CodeGenCXX/attr.cpp
@@ -4,7 +4,7 @@
 
 // CHECK: define{{.*}} i32 @_Z3foov() [[NUW:#[0-9]+]] align 1024
 int foo() __attribute__((aligned(1024)));
-int foo() { }
+int foo() { return 0; }
 
 class C {
   virtual void bar1() __attribute__((aligned(1)));

diff  --git a/clang/test/CodeGenCXX/c-linkage.cpp b/clang/test/CodeGenCXX/c-linkage.cpp
index 0f4c3277253f72..bc2c0c5380f427 100644
--- a/clang/test/CodeGenCXX/c-linkage.cpp
+++ b/clang/test/CodeGenCXX/c-linkage.cpp
@@ -29,5 +29,6 @@ extern "C" {
   struct test3_s {
   };
   bool operator==(const int& a, const test3_s& b)  {
+    return false;
   }
 }

diff  --git a/clang/test/CodeGenCXX/catch-undef-behavior.cpp b/clang/test/CodeGenCXX/catch-undef-behavior.cpp
index 419d1292551a08..15feebe0c09930 100644
--- a/clang/test/CodeGenCXX/catch-undef-behavior.cpp
+++ b/clang/test/CodeGenCXX/catch-undef-behavior.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -fsanitize=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift-base,shift-exponent,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -fsanitize-recover=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift-base,shift-exponent,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-FUNCSAN
-// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -fsanitize=vptr,address -fsanitize-recover=vptr,address -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-ASAN
-// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -fsanitize=vptr -fsanitize-recover=vptr -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=DOWNCAST-NULL
-// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -fsanitize=function -emit-llvm %s -o - -triple x86_64-linux-gnux32 | FileCheck %s --check-prefix=CHECK-FUNCSAN
-// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -fsanitize=function -emit-llvm %s -o - -triple i386-linux-gnu | FileCheck %s --check-prefix=CHECK-FUNCSAN
+// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -Wno-error=return-type -fsanitize=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift-base,shift-exponent,unreachable,return,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -fsanitize-recover=signed-integer-overflow,integer-divide-by-zero,float-divide-by-zero,shift-base,shift-exponent,vla-bound,alignment,null,vptr,object-size,float-cast-overflow,bool,enum,array-bounds,function -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,CHECK-FUNCSAN
+// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -Wno-error=return-type -fsanitize=vptr,address -fsanitize-recover=vptr,address -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=CHECK-ASAN
+// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -Wno-error=return-type -fsanitize=vptr -fsanitize-recover=vptr -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s --check-prefix=DOWNCAST-NULL
+// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -Wno-error=return-type -fsanitize=function -emit-llvm %s -o - -triple x86_64-linux-gnux32 | FileCheck %s --check-prefix=CHECK-FUNCSAN
+// RUN: %clang_cc1 -no-enable-noundef-analysis -std=c++11 -Wno-error=return-type -fsanitize=function -emit-llvm %s -o - -triple i386-linux-gnu | FileCheck %s --check-prefix=CHECK-FUNCSAN
 
 struct S {
   double d;

diff  --git a/clang/test/CodeGenCXX/conditional-gnu-ext.cpp b/clang/test/CodeGenCXX/conditional-gnu-ext.cpp
index 3d3d210f22f693..4411d4269b8cde 100644
--- a/clang/test/CodeGenCXX/conditional-gnu-ext.cpp
+++ b/clang/test/CodeGenCXX/conditional-gnu-ext.cpp
@@ -11,7 +11,7 @@ void test0() {
 namespace radar8446940 {
 extern "C" void abort();
 
-int main () {
+void main () {
   char x[1];
   char *y = x ? : 0;
 

diff  --git a/clang/test/CodeGenCXX/cxx1y-variable-template-linkage.cpp b/clang/test/CodeGenCXX/cxx1y-variable-template-linkage.cpp
index ac542870f1f4b8..7bc82eff66790c 100644
--- a/clang/test/CodeGenCXX/cxx1y-variable-template-linkage.cpp
+++ b/clang/test/CodeGenCXX/cxx1y-variable-template-linkage.cpp
@@ -55,6 +55,9 @@ static const int &foo() {
      // CHECK-DAG: @_Z1tIKiE
      return t<const int>;
    }
+
+   static int x;
+   return x;
 }
 
 

diff  --git a/clang/test/CodeGenCXX/debug-info-cxx0x.cpp b/clang/test/CodeGenCXX/debug-info-cxx0x.cpp
index 4c31f60c0d9652..c21a0bb1ad5a1a 100644
--- a/clang/test/CodeGenCXX/debug-info-cxx0x.cpp
+++ b/clang/test/CodeGenCXX/debug-info-cxx0x.cpp
@@ -12,7 +12,7 @@ namespace PR13570 {
   template<typename T, typename U> struct P {};
   template<typename T> struct A {
     template<typename U> static P<T,U> isa(U);
-    decltype(isa(int())) f() {}
+    decltype(isa(int())) f() { return {}; }
   };
   template struct A<int>;
 }

diff  --git a/clang/test/CodeGenCXX/debug-info-scoped-class.cpp b/clang/test/CodeGenCXX/debug-info-scoped-class.cpp
index de4aee9a1b448b..7424487df418b8 100644
--- a/clang/test/CodeGenCXX/debug-info-scoped-class.cpp
+++ b/clang/test/CodeGenCXX/debug-info-scoped-class.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone -std=c++11 \
+// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -debug-info-kind=standalone -std=c++11 \
 // RUN:   -triple thumbv7-apple-ios %s -o - | FileCheck %s
 
 // This forward-declared scoped enum will be created while building its own

diff  --git a/clang/test/CodeGenCXX/debug-lambda-this.cpp b/clang/test/CodeGenCXX/debug-lambda-this.cpp
index eecbac6520ac97..019d09c48f858b 100644
--- a/clang/test/CodeGenCXX/debug-lambda-this.cpp
+++ b/clang/test/CodeGenCXX/debug-lambda-this.cpp
@@ -4,9 +4,9 @@ struct D {
   D();
   D(const D&);
   int x;
-  int d(int x);
+  void d(int x);
 };
-int D::d(int x) {
+void D::d(int x) {
   [=] {
     return this->x;
   }();

diff  --git a/clang/test/CodeGenCXX/expr.cpp b/clang/test/CodeGenCXX/expr.cpp
index 33e8e63de2f4a5..d1af538d8c6c80 100644
--- a/clang/test/CodeGenCXX/expr.cpp
+++ b/clang/test/CodeGenCXX/expr.cpp
@@ -24,7 +24,7 @@ int test3g = test3(__PRETTY_FUNCTION__);
 struct test4A {
   int j : 2;
 };
-int test4() {
+void test4() {
   test4A a;
   (a.j = 2) = 3;
 }

diff  --git a/clang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp b/clang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
index 18d2080a611e84..bb21c87eed8ff1 100644
--- a/clang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
+++ b/clang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
@@ -56,6 +56,7 @@ inline int foo() {
     };
   };
   L(3)('a');
+  return 0;
 }
 int use = foo();
 }

diff  --git a/clang/test/CodeGenCXX/mangle-exprs.cpp b/clang/test/CodeGenCXX/mangle-exprs.cpp
index b666eaadf45768..b75f2cf3607b3f 100644
--- a/clang/test/CodeGenCXX/mangle-exprs.cpp
+++ b/clang/test/CodeGenCXX/mangle-exprs.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fclang-abi-compat=latest -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -std=c++11 -fclang-abi-compat=latest -emit-llvm %s -o - -triple=x86_64-apple-darwin9 | FileCheck %s
 
 namespace std {
   typedef decltype(sizeof(int)) size_t;
@@ -327,7 +327,7 @@ namespace test7 {
   template<class T> decltype(T{{1,2}}) fTB(T t) {}
   template<class T> decltype(T({1,2})) fTC(T t) {}
 
-  int main() {
+  void main() {
     fA1(1); // CHECK-LABEL: define {{.*}} @_ZN5test73fA1IiEEDTcmtlNS_1AELi1ELi2EEcvT__EES2_
     fA2(1); // CHECK-LABEL: define {{.*}} @_ZN5test73fA2IiEEDTcmcvNS_1AEilLi1ELi2EEcvT__EES2_
     fB1(1); // CHECK-LABEL: define {{.*}} @_ZN5test73fB1IiEEDTcmtlNS_1BELi1ELi2EEcvT__EES2_

diff  --git a/clang/test/CodeGenCXX/mangle-variadic-templates.cpp b/clang/test/CodeGenCXX/mangle-variadic-templates.cpp
index d2c1b772659031..2fc2cb262a4405 100644
--- a/clang/test/CodeGenCXX/mangle-variadic-templates.cpp
+++ b/clang/test/CodeGenCXX/mangle-variadic-templates.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm -triple=x86_64-apple-darwin9 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -std=c++11 -emit-llvm -triple=x86_64-apple-darwin9 -o - %s | FileCheck %s
 
 template<unsigned I, typename ...Types>
 struct X { };
@@ -47,7 +47,7 @@ template void f3<int>(const int*);
 template void f3<int, float>(const int*, const float*);
 
 // Mangling of type pack expansions in a template argument
-template<typename ...Types> tuple<Types...> f4() {}
+template<typename ...Types> tuple<Types...> f4() { return {}; }
 // CHECK-LABEL: define weak_odr void @_Z2f4IJifdEE5tupleIJDpT_EEv
 template tuple<int, float, double> f4();
 

diff  --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp
index d0800af55c87e8..c5b472670e8c05 100644
--- a/clang/test/CodeGenCXX/mangle.cpp
+++ b/clang/test/CodeGenCXX/mangle.cpp
@@ -645,7 +645,7 @@ namespace test24 {
     foo();
   }
 
-  static char bar() {}
+  static char bar() { return 0; }
   void test1() {
     // CHECK: call noundef signext i8 @_ZN6test24L3barEv()
     bar();
@@ -839,7 +839,7 @@ namespace test36 {
   template<unsigned> struct A { };
 
   template<typename ...Types>
-  auto f1(Types... values) -> A<sizeof...(values)> { }
+  auto f1(Types... values) -> A<sizeof...(values)> { return {}; }
 
   // CHECK: define weak_odr {{.*}} @_ZN6test362f1IJifEEENS_1AIXsZfp_EEEDpT_
   template A<2> f1(int, float);

diff  --git a/clang/test/CodeGenCXX/matrix-type-operators.cpp b/clang/test/CodeGenCXX/matrix-type-operators.cpp
index 8854a718fb13ec..739008d3d0d372 100644
--- a/clang/test/CodeGenCXX/matrix-type-operators.cpp
+++ b/clang/test/CodeGenCXX/matrix-type-operators.cpp
@@ -300,7 +300,11 @@ int test_extract_template(MyMatrix<int, 2, 2> Mat1) {
 using double4x4 = double __attribute__((matrix_type(4, 4)));
 
 template <class R, class C>
-auto matrix_subscript(double4x4 m, R r, C c) -> decltype(m[r][c]) {}
+auto matrix_subscript(double4x4 m, R r, C c) -> decltype(m[r][c]) {
+  // FIXME: We can't actually do 'return m[r][c]' here currently.
+  static double d;
+  return d;
+}
 
 double test_matrix_subscript(double4x4 m) {
   // CHECK-LABEL: @_Z21test_matrix_subscriptu11matrix_typeILm4ELm4EdE(

diff  --git a/clang/test/CodeGenCXX/matrix-type.cpp b/clang/test/CodeGenCXX/matrix-type.cpp
index c3a299e7feee82..de28dcd24507a5 100644
--- a/clang/test/CodeGenCXX/matrix-type.cpp
+++ b/clang/test/CodeGenCXX/matrix-type.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -no-enable-noundef-analysis -fenable-matrix -fclang-abi-compat=latest -triple x86_64-apple-darwin %s -emit-llvm -disable-llvm-passes -o - -std=c++17 | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -no-enable-noundef-analysis -fenable-matrix -fclang-abi-compat=latest -triple x86_64-apple-darwin %s -emit-llvm -disable-llvm-passes -o - -std=c++17 | FileCheck %s
 
 typedef double dx5x5_t __attribute__((matrix_type(5, 5)));
 typedef float fx3x4_t __attribute__((matrix_type(3, 4)));

diff  --git a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
index fa7670c7448145..55dc71a009857c 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
@@ -194,6 +194,7 @@ inline int switch_test(int x) {
       return b + c++;
     }
   };
+  return 0;
 }
 
 int f();

diff  --git a/clang/test/CodeGenCXX/new-alias.cpp b/clang/test/CodeGenCXX/new-alias.cpp
index 5310d47297bbdf..2496e383621811 100644
--- a/clang/test/CodeGenCXX/new-alias.cpp
+++ b/clang/test/CodeGenCXX/new-alias.cpp
@@ -3,11 +3,12 @@
 using size_t = decltype(sizeof(0));
 
 extern "C" char *something(long long x) {
+  return nullptr;
 }
 
 // CHECK: @_Znwm ={{.*}} alias ptr (i64), ptr @something
 void *operator new(size_t) __attribute__((alias("something")));
 
 // PR16715: don't assert here.
-// CHECK: call noalias noundef nonnull ptr @_Znwm(i64 noundef 4) #3{{$}}
+// CHECK: call noalias noundef nonnull ptr @_Znwm(i64 noundef 4)
 int *pr16715 = new int;

diff  --git a/clang/test/CodeGenCXX/nrvo.cpp b/clang/test/CodeGenCXX/nrvo.cpp
index d5bb1c0e45a5cf..1141bc35de5824 100644
--- a/clang/test/CodeGenCXX/nrvo.cpp
+++ b/clang/test/CodeGenCXX/nrvo.cpp
@@ -1,7 +1,7 @@
 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -fcxx-exceptions -fexceptions -disable-llvm-passes -std=c++03 -o - %s | FileCheck --check-prefixes=CHECK-EH-03 %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -fcxx-exceptions -fexceptions -disable-llvm-passes -std=c++11 -DCXX11 -o - %s | FileCheck --check-prefixes=CHECK-EH-11 %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -Wno-error=return-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -Wno-error=return-type -emit-llvm -fcxx-exceptions -fexceptions -disable-llvm-passes -std=c++03 -o - %s | FileCheck --check-prefixes=CHECK-EH-03 %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -Wno-error=return-type -emit-llvm -fcxx-exceptions -fexceptions -disable-llvm-passes -std=c++11 -DCXX11 -o - %s | FileCheck --check-prefixes=CHECK-EH-11 %s
 
 // Test code generation for the named return value optimization.
 class X {

diff  --git a/clang/test/CodeGenCXX/reference-field.cpp b/clang/test/CodeGenCXX/reference-field.cpp
index 54e914d0f3fce5..7c78c99eb3d8fe 100644
--- a/clang/test/CodeGenCXX/reference-field.cpp
+++ b/clang/test/CodeGenCXX/reference-field.cpp
@@ -3,6 +3,6 @@
 // Make sure the call to b() doesn't get optimized out.
 extern struct x {char& x,y;}y;
 int b();      
-int a() { if (!&y.x) b(); }
+void a() { if (!&y.x) b(); }
 
 // CHECK: @_Z1bv

diff  --git a/clang/test/CodeGenCXX/return.cpp b/clang/test/CodeGenCXX/return.cpp
index 584c2921c1e7fb..a281d71a271c67 100644
--- a/clang/test/CodeGenCXX/return.cpp
+++ b/clang/test/CodeGenCXX/return.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -o - %s | FileCheck --check-prefixes=CHECK,CHECK-COMMON %s
-// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -O -o - %s | FileCheck %s --check-prefixes=CHECK-OPT,CHECK-COMMON
-// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -fno-strict-return -o - %s | FileCheck %s --check-prefixes=CHECK-NOSTRICT,CHECK-COMMON
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -Wno-error=return-type -o - %s | FileCheck --check-prefixes=CHECK,CHECK-COMMON %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -Wno-error=return-type -O -o - %s | FileCheck %s --check-prefixes=CHECK-OPT,CHECK-COMMON
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -fno-strict-return -Wno-error=return-type -o - %s | FileCheck %s --check-prefixes=CHECK-NOSTRICT,CHECK-COMMON
 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -fno-strict-return -Wno-return-type -o - %s | FileCheck %s --check-prefixes=CHECK-NOSTRICT,CHECK-COMMON
-// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -fno-strict-return -O -o - %s | FileCheck %s --check-prefixes=CHECK-NOSTRICT-OPT,CHECK-COMMON
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -fno-strict-return -Wno-error=return-type -O -o - %s | FileCheck %s --check-prefixes=CHECK-NOSTRICT-OPT,CHECK-COMMON
 
 // CHECK-COMMON-LABEL: @_Z9no_return
 int no_return() {

diff  --git a/clang/test/CodeGenCXX/template-instantiation.cpp b/clang/test/CodeGenCXX/template-instantiation.cpp
index 8453bcefc7ebbf..f1797cb69870db 100644
--- a/clang/test/CodeGenCXX/template-instantiation.cpp
+++ b/clang/test/CodeGenCXX/template-instantiation.cpp
@@ -140,7 +140,7 @@ namespace test4 {
     B b;
   }
 
-  unsigned test() {
+  void test() {
     A<int>::foo();
   }
 }

diff  --git a/clang/test/CodeGenCXX/trap-fnattr.cpp b/clang/test/CodeGenCXX/trap-fnattr.cpp
index 21422bc94f6fbe..ed7162fc43a6c0 100644
--- a/clang/test/CodeGenCXX/trap-fnattr.cpp
+++ b/clang/test/CodeGenCXX/trap-fnattr.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -O0 -emit-llvm -ftrapv -ftrap-function=mytrap %s -o - | FileCheck %s -check-prefix=TRAPFUNC
-// RUN: %clang_cc1 -O0 -emit-llvm -ftrapv %s -o - | FileCheck %s -check-prefix=NOOPTION
+// RUN: %clang_cc1 -O0 -emit-llvm -Wno-error=return-type -ftrapv -ftrap-function=mytrap %s -o - | FileCheck %s -check-prefix=TRAPFUNC
+// RUN: %clang_cc1 -O0 -emit-llvm -Wno-error=return-type -ftrapv %s -o - | FileCheck %s -check-prefix=NOOPTION
 
 // TRAPFUNC-LABEL: define {{(dso_local )?}}void @{{_Z12test_builtinv|\"\?test_builtin@@YAXXZ\"}}
 // TRAPFUNC: call void @llvm.trap() [[ATTR0:#[0-9]+]]

diff  --git a/clang/test/CodeGenCXX/ubsan-check-debuglocs.cpp b/clang/test/CodeGenCXX/ubsan-check-debuglocs.cpp
index 96a697aca5eb1b..81db5c4912613d 100644
--- a/clang/test/CodeGenCXX/ubsan-check-debuglocs.cpp
+++ b/clang/test/CodeGenCXX/ubsan-check-debuglocs.cpp
@@ -8,7 +8,7 @@
 // CHECK-SAME: !dbg
 
 struct SourceLocation {
-  SourceLocation acquire() {};
+  SourceLocation acquire() { return {}; };
 };
 extern "C" void __ubsan_handle_type_mismatch_v1(SourceLocation *Loc);
 static void handleTypeMismatchImpl(SourceLocation *Loc) { Loc->acquire(); }

diff  --git a/clang/test/CodeGenObjC/2007-10-18-ProDescriptor.m b/clang/test/CodeGenObjC/2007-10-18-ProDescriptor.m
index 35a0df3a1a9f27..b3eda57eec5d27 100644
--- a/clang/test/CodeGenObjC/2007-10-18-ProDescriptor.m
+++ b/clang/test/CodeGenObjC/2007-10-18-ProDescriptor.m
@@ -14,5 +14,6 @@ @interface AGy:O < AB > {
 @end
 @implementation AGy
 - (unsigned) ver {
+    return 0;
 }
 @end

diff  --git a/clang/test/CodeGenObjC/2008-11-25-Blocks.m b/clang/test/CodeGenObjC/2008-11-25-Blocks.m
index f0be6de338980b..60615f78a049b9 100644
--- a/clang/test/CodeGenObjC/2008-11-25-Blocks.m
+++ b/clang/test/CodeGenObjC/2008-11-25-Blocks.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fblocks -emit-llvm %s -o /dev/null
+// RUN: %clang_cc1 -Wno-error=return-type -fblocks -emit-llvm %s -o /dev/null
 
 @interface bork
 - (id)B:(void (^)(void))blk;

diff  --git a/clang/test/CodeGenObjC/debug-info-crash.m b/clang/test/CodeGenObjC/debug-info-crash.m
index 85b9b7d334f941..845a65ec41d583 100644
--- a/clang/test/CodeGenObjC/debug-info-crash.m
+++ b/clang/test/CodeGenObjC/debug-info-crash.m
@@ -36,5 +36,6 @@ + (void)initialize {
 }
 + (NSAttributedString *)attributedStringWithString:(id)string image:(NSImage *)image  {
   NSMutableAttributedString *attrStr;
+  return 0;
 }
 @end

diff  --git a/clang/test/CodeGenObjC/encode-test.m b/clang/test/CodeGenObjC/encode-test.m
index 78a70a00e072e8..b07e9e9926dc33 100644
--- a/clang/test/CodeGenObjC/encode-test.m
+++ b/clang/test/CodeGenObjC/encode-test.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple i686-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
 // RUN: FileCheck < %t %s
 //
 // CHECK: @OBJC_METH_VAR_TYPE_{{.*}} = private unnamed_addr constant [16 x i8] c"v12 at 0:4[3[4@]]8\00"

diff  --git a/clang/test/CodeGenObjC/message-arrays.m b/clang/test/CodeGenObjC/message-arrays.m
index 3e8697fc937605..bd5b05fda31dce 100644
--- a/clang/test/CodeGenObjC/message-arrays.m
+++ b/clang/test/CodeGenObjC/message-arrays.m
@@ -9,7 +9,7 @@ @interface A
 -(void) m: (int) arg0, ...;
 @end
 
-int f1(A *a) {
+void f1(A *a) {
   // This should also get an implicit cast (for the vararg)
   [a m: 1, "test"];
 }

diff  --git a/clang/test/CodeGenObjC/metadata-symbols-32.m b/clang/test/CodeGenObjC/metadata-symbols-32.m
index 825b2c61c55dff..716b26790bd333 100644
--- a/clang/test/CodeGenObjC/metadata-symbols-32.m
+++ b/clang/test/CodeGenObjC/metadata-symbols-32.m
@@ -80,7 +80,7 @@ @interface J0
 
 @implementation J0(Category) @end
 
-void *f0(void) {
+void f0(void) {
    [B im0];
    [C im1];
 }

diff  --git a/clang/test/CodeGenObjC/metadata-symbols-64.m b/clang/test/CodeGenObjC/metadata-symbols-64.m
index 96a79470bfdde4..944acd20f0d50b 100644
--- a/clang/test/CodeGenObjC/metadata-symbols-64.m
+++ b/clang/test/CodeGenObjC/metadata-symbols-64.m
@@ -116,7 +116,7 @@ - (long double) RET_LONGDOUBLE
    }
 @end
 
-void *f0(id x) {
+void f0(id x) {
    Example* pe;
    double dd = [pe RET_DOUBLE];
    dd = [pe RET_FLOAT];

diff  --git a/clang/test/CodeGenObjC/objc2-weak-compare.m b/clang/test/CodeGenObjC/objc2-weak-compare.m
index 093a78abc48921..b42fc5b396ed3c 100644
--- a/clang/test/CodeGenObjC/objc2-weak-compare.m
+++ b/clang/test/CodeGenObjC/objc2-weak-compare.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
-// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
+// RUN: %clang_cc1 -Wno-error=return-type -x objective-c++ -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
 
 @interface PBXTarget 
 {

diff  --git a/clang/test/CodeGenObjC/objc2-write-barrier-2.m b/clang/test/CodeGenObjC/objc2-write-barrier-2.m
index 6bc2f509083bcc..68a9e7726e5c17 100644
--- a/clang/test/CodeGenObjC/objc2-write-barrier-2.m
+++ b/clang/test/CodeGenObjC/objc2-write-barrier-2.m
@@ -78,6 +78,7 @@ @implementation DSATextSearch
   inner.inner_most.nestedDeeperNames[filteredPos] = 0;
   inner.inner_most.arrI[3].is1[5] = 0;
   inner.inner_most.arrI[3].is2[5] = 0;
+  return 0;
 }
 @end
 

diff  --git a/clang/test/CodeGenObjC/protocols-lazy.m b/clang/test/CodeGenObjC/protocols-lazy.m
index 6764d0487fe36f..5e5e78c4be75ec 100644
--- a/clang/test/CodeGenObjC/protocols-lazy.m
+++ b/clang/test/CodeGenObjC/protocols-lazy.m
@@ -41,7 +41,7 @@ @interface UserP5<P5> // This generates a forward
 @protocol P5 -im1; @end
 @implementation UserP5
 
-- im1 { }
+- im1 { __builtin_unreachable(); }
 
 @end
 

diff  --git a/clang/test/CodeGenObjC/strong-in-c-struct.m b/clang/test/CodeGenObjC/strong-in-c-struct.m
index d7febd27412179..36f50aa98561b1 100644
--- a/clang/test/CodeGenObjC/strong-in-c-struct.m
+++ b/clang/test/CodeGenObjC/strong-in-c-struct.m
@@ -819,10 +819,10 @@ id test_conditional0(int c) {
   return (c ? g2 : g1).f1;
 }
 
-// CHECK-LABEL: define{{.*}} ptr @test_conditional1(
+// CHECK-LABEL: define{{.*}} void @test_conditional1(
 // CHECK-NOT: call void @__destructor
 
-id test_conditional1(int c) {
+void test_conditional1(int c) {
   calleeStrongSmall(c ? g2 : g1);
 }
 
@@ -836,10 +836,10 @@ id test_assignment0(void) {
   return (g2 = g1).f1;
 }
 
-// CHECK-LABEL: define{{.*}} ptr @test_assignment1(
+// CHECK-LABEL: define{{.*}} void @test_assignment1(
 // CHECK-NOT: call void @__destructor
 
-id test_assignment1(void) {
+void test_assignment1(void) {
   calleeStrongSmall(g2 = g1);
 }
 

diff  --git a/clang/test/CodeGenObjCXX/debug-info-line.mm b/clang/test/CodeGenObjCXX/debug-info-line.mm
index bb6eaa50d7cca3..9f543dbaf962d5 100644
--- a/clang/test/CodeGenObjCXX/debug-info-line.mm
+++ b/clang/test/CodeGenObjCXX/debug-info-line.mm
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-windows-gnu -fcxx-exceptions -fexceptions -debug-info-kind=line-tables-only -fblocks -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -triple x86_64-unknown-windows-gnu -fcxx-exceptions -fexceptions -debug-info-kind=line-directives-only -fblocks -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-unknown-windows-gnu -fcxx-exceptions -fexceptions -debug-info-kind=line-tables-only -fblocks -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-unknown-windows-gnu -fcxx-exceptions -fexceptions -debug-info-kind=line-directives-only -fblocks -emit-llvm %s -o - | FileCheck %s
 
 void fn();
 

diff  --git a/clang/test/CodeGenObjCXX/instantiate-return.mm b/clang/test/CodeGenObjCXX/instantiate-return.mm
index fe59602b395db2..6e41d9b3d26661 100644
--- a/clang/test/CodeGenObjCXX/instantiate-return.mm
+++ b/clang/test/CodeGenObjCXX/instantiate-return.mm
@@ -18,5 +18,6 @@ @interface C1
 
 @implementation C1
 - (TemplateClass<S0>)m1 {
+    __builtin_unreachable();
 }
 @end

diff  --git a/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm b/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm
index cfc6d78b6b8880..01fa98bd72f5b2 100644
--- a/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm
+++ b/clang/test/CodeGenObjCXX/pr14474-gline-tables-only.mm
@@ -1,7 +1,7 @@
 // PR 14474
-// RUN: %clang_cc1 -triple i386-apple-macosx10.6.0 -emit-llvm \
+// RUN: %clang_cc1 -Wno-error=return-type -triple i386-apple-macosx10.6.0 -emit-llvm \
 // RUN:   -debug-info-kind=line-tables-only -x objective-c++ -o /dev/null %s
-// RUN: %clang_cc1 -triple i386-apple-macosx10.6.0 -emit-llvm \
+// RUN: %clang_cc1 -Wno-error=return-type -triple i386-apple-macosx10.6.0 -emit-llvm \
 // RUN:   -debug-info-kind=line-directives-only -x objective-c++ -o /dev/null %s
 
 typedef signed char BOOL;

diff  --git a/clang/test/CodeGenObjCXX/property-dot-reference.mm b/clang/test/CodeGenObjCXX/property-dot-reference.mm
index 245aa4176c7df9..ad745b566beab1 100644
--- a/clang/test/CodeGenObjCXX/property-dot-reference.mm
+++ b/clang/test/CodeGenObjCXX/property-dot-reference.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -o - %s | FileCheck %s
 
 struct TFENode {
 void GetURL() const;

diff  --git a/clang/test/CodeGenObjCXX/return.mm b/clang/test/CodeGenObjCXX/return.mm
index fb77f336dfc00a..c544e541319080 100644
--- a/clang/test/CodeGenObjCXX/return.mm
+++ b/clang/test/CodeGenObjCXX/return.mm
@@ -1,6 +1,6 @@
 /// -fstrict-return is the default.
-// RUN: %clang_cc1 -emit-llvm -fblocks -triple x86_64-apple-darwin -o - %s | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -fblocks -triple x86_64-apple-darwin -O -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -fblocks -triple x86_64-apple-darwin -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -emit-llvm -fblocks -triple x86_64-apple-darwin -O -o - %s | FileCheck %s
 
 @interface I
 @end

diff  --git a/clang/test/CoverageMapping/switch.cpp b/clang/test/CoverageMapping/switch.cpp
index db4cddbc6b9415..1d44e7adeee4c1 100644
--- a/clang/test/CoverageMapping/switch.cpp
+++ b/clang/test/CoverageMapping/switch.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++1z -triple %itanium_abi_triple -main-file-name switch.cpp %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=return-type -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++1z -triple %itanium_abi_triple -main-file-name switch.cpp %s | FileCheck %s
 
 // CHECK: foo
 void foo(int i) {   // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+11]]:2 = #0

diff  --git a/clang/test/Driver/cc-log-diagnostics.c b/clang/test/Driver/cc-log-diagnostics.c
index 1e21c6a76022cc..8cca0e9535c380 100644
--- a/clang/test/Driver/cc-log-diagnostics.c
+++ b/clang/test/Driver/cc-log-diagnostics.c
@@ -4,7 +4,7 @@
 // RUN: %clang -Wfoobar --target=x86_64-apple-darwin11 -fsyntax-only %s
 // RUN: FileCheck %s < %t.log
 
-int f0(void) {}
+int;
 
 // CHECK: <dict>
 // CHECK:   <key>main-file</key>
@@ -27,9 +27,9 @@ int f0(void) {}
 // CHECK:       <key>line</key>
 // CHECK:       <integer>7</integer>
 // CHECK:       <key>column</key>
-// CHECK:       <integer>15</integer>
+// CHECK:       <integer>1</integer>
 // CHECK:       <key>message</key>
-// CHECK:       <string>non-void function does not return a value</string>
+// CHECK:       <string>declaration does not declare anything</string>
 // CHECK:     </dict>
 // CHECK:   </array>
 // CHECK: </dict>

diff  --git a/clang/test/FixIt/fixit-availability-maccatalyst.m b/clang/test/FixIt/fixit-availability-maccatalyst.m
index 1b4cec8a9fe4db..c63c9dd09c7431 100644
--- a/clang/test/FixIt/fixit-availability-maccatalyst.m
+++ b/clang/test/FixIt/fixit-availability-maccatalyst.m
@@ -5,7 +5,7 @@
 
 void anotherFunction(int function);
 
-int use(void) {
+void use(void) {
   function();
 // CHECK: fix-it:{{.*}}:{[[@LINE-1]]:3-[[@LINE-1]]:3}:"if (@available(macCatalyst 13.2, *)) {\n      "
 // CHECK-NEXT: fix-it:{{.*}}:{[[@LINE-2]]:14-[[@LINE-2]]:14}:"\n  } else {\n      // Fallback on earlier versions\n  }"

diff  --git a/clang/test/FixIt/fixit-c++11.cpp b/clang/test/FixIt/fixit-c++11.cpp
index e635c14e0c2155..acbc1b11f88e43 100644
--- a/clang/test/FixIt/fixit-c++11.cpp
+++ b/clang/test/FixIt/fixit-c++11.cpp
@@ -59,7 +59,7 @@ void S2::f(int i) {
   (void)[i, i]{ }; // expected-error{{'i' can appear only once in a capture list}}
   (void)[&, i, i]{ }; // expected-error{{'i' can appear only once in a capture list}}
   (void)[] mutable {};
-  (void)[]->int{};
+  (void)[]->int{ return 0; };
 #if __cplusplus <= 202002L
   // expected-warning at -3{{is a C++23 extension}}
   // expected-warning at -3{{is a C++23 extension}}

diff  --git a/clang/test/Frontend/absolute-paths.c b/clang/test/Frontend/absolute-paths.c
index 8a9687195c36b5..e06cf262dd8e2e 100644
--- a/clang/test/Frontend/absolute-paths.c
+++ b/clang/test/Frontend/absolute-paths.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -I %S/Inputs/SystemHeaderPrefix/.. %s 2>&1 | FileCheck -DROOT_ABSOLUTE=%s -check-prefix=NORMAL -check-prefix=CHECK %s
-// RUN: %clang_cc1 -fsyntax-only -I %S/Inputs/SystemHeaderPrefix/.. -fdiagnostics-absolute-paths %s 2>&1 | FileCheck -DROOT_ABSOLUTE=%s -check-prefix=ABSOLUTE -check-prefix=CHECK %s
+// RUN: %clang_cc1 -Wno-error=return-type -fsyntax-only -I %S/Inputs/SystemHeaderPrefix/.. %s 2>&1 | FileCheck -DROOT_ABSOLUTE=%s -check-prefix=NORMAL -check-prefix=CHECK %s
+// RUN: %clang_cc1 -Wno-error=return-type -fsyntax-only -I %S/Inputs/SystemHeaderPrefix/.. -fdiagnostics-absolute-paths %s 2>&1 | FileCheck -DROOT_ABSOLUTE=%s -check-prefix=ABSOLUTE -check-prefix=CHECK %s
 
 #include "absolute-paths-import.h"
 // NORMAL: In file included from {{.*}}absolute-paths.c:4:

diff  --git a/clang/test/Frontend/ast-codegen.c b/clang/test/Frontend/ast-codegen.c
index 53721a463217fe..2e2e3d360dd177 100644
--- a/clang/test/Frontend/ast-codegen.c
+++ b/clang/test/Frontend/ast-codegen.c
@@ -8,6 +8,6 @@ __asm__("foo");
 // CHECK: @g0 = dso_local global i32 0, align 4
 int g0;
 
-// CHECK: define dso_local i32 @f0()
-int f0(void) {
+// CHECK: define dso_local void @f0()
+void f0(void) {
 }

diff  --git a/clang/test/Frontend/ast-main.cpp b/clang/test/Frontend/ast-main.cpp
index e6e2825bb332a5..fe47ce435f0683 100644
--- a/clang/test/Frontend/ast-main.cpp
+++ b/clang/test/Frontend/ast-main.cpp
@@ -1,6 +1,6 @@
-// RUN: env SDKROOT="/" %clang -emit-llvm -S -o %t1.ll -x c++ - < %s
-// RUN: env SDKROOT="/" %clang -fno-delayed-template-parsing -emit-ast -o %t.ast %s
-// RUN: env SDKROOT="/" %clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast
+// RUN: env SDKROOT="/" %clang -Wno-error=return-type -emit-llvm -S -o %t1.ll -x c++ - < %s
+// RUN: env SDKROOT="/" %clang -Wno-error=return-type -fno-delayed-template-parsing -emit-ast -o %t.ast %s
+// RUN: env SDKROOT="/" %clang -Wno-error=return-type -emit-llvm -S -o %t2.ll -x ast - < %t.ast
 // RUN: 
diff  %t1.ll %t2.ll
 
 // http://llvm.org/bugs/show_bug.cgi?id=15377

diff  --git a/clang/test/Misc/serialized-diags-stable.c b/clang/test/Misc/serialized-diags-stable.c
index e8ee83ec7499db..f2278a3ed9dc4f 100644
--- a/clang/test/Misc/serialized-diags-stable.c
+++ b/clang/test/Misc/serialized-diags-stable.c
@@ -1,5 +1,5 @@
 // RUN: rm -f %t
-// RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1
+// RUN: not %clang -Wno-error=return-type -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1
 // RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s
 
 // RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s

diff  --git a/clang/test/Modules/pr61067.cppm b/clang/test/Modules/pr61067.cppm
index 50ab7ba201298d..9e33123ee6dbe6 100644
--- a/clang/test/Modules/pr61067.cppm
+++ b/clang/test/Modules/pr61067.cppm
@@ -49,6 +49,7 @@ import a;
 
 int c() {
     (void)(a() == a());
+    return 0;
 }
 
 // CHECK: define{{.*}}linkonce_odr{{.*}}@_ZW1aeqS_1aS0_(

diff  --git a/clang/test/Modules/redecl-merge.m b/clang/test/Modules/redecl-merge.m
index 746be5ec4e774e..d2a2490572610a 100644
--- a/clang/test/Modules/redecl-merge.m
+++ b/clang/test/Modules/redecl-merge.m
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -Wreturn-type -fmodules-cache-path=%t -I %S/Inputs %s -verify -Wno-objc-root-class
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -Wno-error=return-type -fmodules-cache-path=%t -I %S/Inputs %s -verify -Wno-objc-root-class
 
 @class C2;
 @class C3;

diff  --git a/clang/test/PCH/irgen-rdar13114142.mm b/clang/test/PCH/irgen-rdar13114142.mm
index d3687637eefab2..2257587290d7ce 100644
--- a/clang/test/PCH/irgen-rdar13114142.mm
+++ b/clang/test/PCH/irgen-rdar13114142.mm
@@ -20,11 +20,13 @@
 public:
     OOArray matchAll(const OOString &)const {
         __attribute__((__blocks__(byref))) OOArray out;
+        return {};
     }
 };
 
 OOArray operator & (const OOPattern & pattern) {
     pattern.matchAll(0);
+    return {};
 }
 OOArray operator & (OOString, OOString);
 

diff  --git a/clang/test/PCH/late-parsed-instantiations.cpp b/clang/test/PCH/late-parsed-instantiations.cpp
index 9ae6b56a09befa..080be09f6748cb 100644
--- a/clang/test/PCH/late-parsed-instantiations.cpp
+++ b/clang/test/PCH/late-parsed-instantiations.cpp
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -emit-pch %s -o %t.pch -verify
-// RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify
+// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -emit-pch %s -o %t.pch -verify
+// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify
 
-// RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -emit-pch -fpch-instantiate-templates %s -o %t.pch -verify
-// RUN: %clang_cc1 -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify
+// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -emit-pch -fpch-instantiate-templates %s -o %t.pch -verify
+// RUN: %clang_cc1 -Wno-error=return-type -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify
 
 // Run this test for i686 as this is the target that modifies default FP options.
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fdelayed-template-parsing -std=c++14 -emit-pch -fpch-instantiate-templates %s -o %t.pch -verify
-// RUN: %clang_cc1 -triple i686-pc-linux-gnu -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify
+// RUN: %clang_cc1 -Wno-error=return-type -triple i686-pc-linux-gnu -fdelayed-template-parsing -std=c++14 -emit-pch -fpch-instantiate-templates %s -o %t.pch -verify
+// RUN: %clang_cc1 -Wno-error=return-type -triple i686-pc-linux-gnu -fdelayed-template-parsing -std=c++14 -include-pch %t.pch %s -verify
 
 #ifndef HEADER_INCLUDED
 

diff  --git a/clang/test/PCH/pr4489.c b/clang/test/PCH/pr4489.c
index 574e33f18c0d7b..a8f686ca445756 100644
--- a/clang/test/PCH/pr4489.c
+++ b/clang/test/PCH/pr4489.c
@@ -1,6 +1,6 @@
-// RUN: %clang -x c-header -o %t.pch %s
+// RUN: %clang -Wno-error=return-type -x c-header -o %t.pch %s
 // RUN: echo > %t.empty.c
-// RUN: %clang -include %t -x c %t.empty.c -emit-llvm -S -o -
+// RUN: %clang -Wno-error=return-type -include %t -x c %t.empty.c -emit-llvm -S -o -
 
 // PR 4489: Crash with PCH
 // PR 4492: Crash with PCH (round two)

diff  --git a/clang/test/PCH/va_arg.c b/clang/test/PCH/va_arg.c
index 2bbf3c5ebd75a3..44a7d2b8ba5b6d 100644
--- a/clang/test/PCH/va_arg.c
+++ b/clang/test/PCH/va_arg.c
@@ -10,10 +10,12 @@ char *g0(char** argv, int argc) { return argv[argc]; }
 
 char *g(char **argv) {
   f(g0, argv, 1, 2, 3);
+  return argv[0];
 }
 
 char *i0(char **argv, int argc) { return argv[argc]; }
 
 char *i(char **argv) {
   h(i0, argv, 1, 2, 3);
+  return argv[0];
 }

diff  --git a/clang/test/PCH/va_arg.h b/clang/test/PCH/va_arg.h
index 255c6589a7e856..beb49396f7b746 100644
--- a/clang/test/PCH/va_arg.h
+++ b/clang/test/PCH/va_arg.h
@@ -5,6 +5,7 @@ char *f (char * (*g) (char **, int), char **p, ...) {
     char *s;
     va_list v;
     s = g (p, __builtin_va_arg(v, int));
+    return s;
 }
 
 typedef __builtin_ms_va_list __ms_va_list;
@@ -12,4 +13,5 @@ char *__attribute__((ms_abi)) h(char *(*i)(char **, int), char **p, ...) {
   char *s;
   __ms_va_list v;
   s = i(p, __builtin_va_arg(v, int));
+  return s;
 }

diff  --git a/clang/test/Parser/promote_types_in_proto.c b/clang/test/Parser/promote_types_in_proto.c
index 969ba28120f239..650dae0a5e7271 100644
--- a/clang/test/Parser/promote_types_in_proto.c
+++ b/clang/test/Parser/promote_types_in_proto.c
@@ -2,7 +2,7 @@
 void functionPromotion(void f(char *const []));
 void arrayPromotion(char * const argv[]);
 
-int whatever(int argc, char *argv[])
+void whatever(int argc, char *argv[])
 {
         arrayPromotion(argv);
         functionPromotion(arrayPromotion);

diff  --git a/clang/test/Rewriter/rewrite-extern-c.mm b/clang/test/Rewriter/rewrite-extern-c.mm
index 2941504ab78d87..daebb07f8fbf2c 100644
--- a/clang/test/Rewriter/rewrite-extern-c.mm
+++ b/clang/test/Rewriter/rewrite-extern-c.mm
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -x objective-c++ -fblocks -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 -o - %s
 
 extern "C" {
-        short foo() { } 
+        short foo() { return 0; }
 }
 typedef unsigned char Boolean;
 

diff  --git a/clang/test/Sema/freemain.c b/clang/test/Sema/freemain.c
index 83d7a4d56eac9a..7bd08c4ed7904d 100644
--- a/clang/test/Sema/freemain.c
+++ b/clang/test/Sema/freemain.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-openbsd -fsyntax-only -verify -ffreestanding %s
+// RUN: %clang_cc1 -Werror=return-type -triple i686-pc-openbsd -fsyntax-only -verify -ffreestanding %s
 
 // Tests that -ffreestanding disables all special treatment of main().
 
@@ -6,4 +6,4 @@ void* allocate(long size);
 
 void* main(void* context, long size) {
   if (context) return allocate(size);
-} // expected-warning {{non-void function does not return a value in all control paths}}
+} // expected-error {{non-void function does not return a value in all control paths}}

diff  --git a/clang/test/Sema/return-type-mismatch.c b/clang/test/Sema/return-type-mismatch.c
index 79a625d7df1f54..d3d0e37c06db43 100644
--- a/clang/test/Sema/return-type-mismatch.c
+++ b/clang/test/Sema/return-type-mismatch.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wreturn-type -Wno-return-mismatch -fsyntax-only -verify=return-type %s
+// RUN: %clang_cc1 -Wno-error=return-type -Wno-return-mismatch -fsyntax-only -verify=return-type %s
 // RUN: %clang_cc1 -Wno-return-type -Wreturn-mismatch -fsyntax-only -verify=return-mismatch %s
 
 int foo(void) __attribute__((noreturn));

diff  --git a/clang/test/SemaCXX/attr-noreturn.cpp b/clang/test/SemaCXX/attr-noreturn.cpp
index e6de5ad45d340a..f2d4964f8ebd86 100644
--- a/clang/test/SemaCXX/attr-noreturn.cpp
+++ b/clang/test/SemaCXX/attr-noreturn.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -Wno-error=return-type -fsyntax-only -verify %s
 
 // Reachability tests have to come first because they get suppressed
 // if any errors have occurred.

diff  --git a/clang/test/SemaCXX/constant-expression-cxx14.cpp b/clang/test/SemaCXX/constant-expression-cxx14.cpp
index 579883ae52ccee..e16a69df3830de 100644
--- a/clang/test/SemaCXX/constant-expression-cxx14.cpp
+++ b/clang/test/SemaCXX/constant-expression-cxx14.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,cxx20_23,cxx23          %s -fcxx-exceptions -triple=x86_64-linux-gnu
-// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx14_20,cxx20_23,cxx20 %s -fcxx-exceptions -triple=x86_64-linux-gnu
-// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify=expected,cxx14_20,cxx14          %s -fcxx-exceptions -triple=x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++23 -Werror=return-type -fsyntax-only -verify=expected,cxx20_23,cxx23          %s -fcxx-exceptions -triple=x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++20 -Werror=return-type -fsyntax-only -verify=expected,cxx14_20,cxx20_23,cxx20 %s -fcxx-exceptions -triple=x86_64-linux-gnu
+// RUN: %clang_cc1 -std=c++14 -Werror=return-type -fsyntax-only -verify=expected,cxx14_20,cxx14          %s -fcxx-exceptions -triple=x86_64-linux-gnu
 
 struct S {
   // dummy ctor to make this a literal type
@@ -68,7 +68,7 @@ constexpr int j(int k) {
     }
   }
 } // expected-note 2{{control reached end of constexpr function}}
-  // cxx23-warning at -1 {{does not return a value in all control paths}}
+  // cxx23-error at -1 {{does not return a value in all control paths}}
 static_assert(j(0) == -3, "");
 static_assert(j(1) == 5, "");
 static_assert(j(2), ""); // expected-error {{constant expression}} expected-note {{in call to 'j(2)'}}

diff  --git a/clang/test/SemaCXX/constexpr-return-non-void-cxx2b.cpp b/clang/test/SemaCXX/constexpr-return-non-void-cxx2b.cpp
index e3228dddef5f66..713ba90a003494 100644
--- a/clang/test/SemaCXX/constexpr-return-non-void-cxx2b.cpp
+++ b/clang/test/SemaCXX/constexpr-return-non-void-cxx2b.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++23 -fsyntax-only -Wimplicit-fallthrough -Wconsumed -verify %s
+// RUN: %clang_cc1 -Wno-error=return-type -std=c++23 -fsyntax-only -Wimplicit-fallthrough -Wconsumed -verify %s
 
 constexpr int f() { } // expected-warning {{non-void function does not return a value}}
 static_assert(__is_same(decltype([] constexpr -> int { }( )), int)); // expected-warning {{non-void lambda does not return a value}}

diff  --git a/clang/test/SemaCXX/err-missing-noreturn-1.cpp b/clang/test/SemaCXX/err-missing-noreturn-1.cpp
new file mode 100644
index 00000000000000..29627a7bef1d3e
--- /dev/null
+++ b/clang/test/SemaCXX/err-missing-noreturn-1.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn -Wreturn-type -Werror=return-type
+
+struct rdar8875247 {
+  ~rdar8875247 ();
+};
+
+int rdar8875247_test() {
+  rdar8875247 f;
+} // expected-error{{non-void function does not return a value}}

diff  --git a/clang/test/SemaCXX/err-missing-noreturn-2.cpp b/clang/test/SemaCXX/err-missing-noreturn-2.cpp
new file mode 100644
index 00000000000000..b1888fbb33ccf2
--- /dev/null
+++ b/clang/test/SemaCXX/err-missing-noreturn-2.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn -Wreturn-type
+// expected-no-diagnostics
+
+namespace GH63009 {
+struct S1 {
+  [[noreturn]] S1();
+};
+
+int foo();
+
+int test_1() {
+  S1 s1;
+  foo();
+}
+}

diff  --git a/clang/test/SemaCXX/return-noreturn.cpp b/clang/test/SemaCXX/return-noreturn.cpp
index b88e5a519d1bb0..873e4c7e12f23b 100644
--- a/clang/test/SemaCXX/return-noreturn.cpp
+++ b/clang/test/SemaCXX/return-noreturn.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -fcxx-exceptions -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
-// RUN: %clang_cc1 %s -fsyntax-only -fcxx-exceptions -std=c++11 -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
+// RUN: %clang_cc1 %s -fsyntax-only -fcxx-exceptions -verify -Wreturn-type -Wno-error=return-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
+// RUN: %clang_cc1 %s -fsyntax-only -fcxx-exceptions -std=c++11 -verify -Wreturn-type -Wno-error=return-type -Wmissing-noreturn -Wno-unreachable-code -Wno-covered-switch-default
 
 // A destructor may be marked noreturn and should still influence the CFG.
 void pr6884_abort() __attribute__((noreturn));

diff  --git a/clang/test/SemaCXX/warn-missing-noreturn.cpp b/clang/test/SemaCXX/warn-missing-noreturn.cpp
index 32b49e0a325f26..208a0fae68cd1c 100644
--- a/clang/test/SemaCXX/warn-missing-noreturn.cpp
+++ b/clang/test/SemaCXX/warn-missing-noreturn.cpp
@@ -88,10 +88,6 @@ struct rdar8875247 {
 };
 void rdar8875247_aux();
 
-int rdar8875247_test() {
-  rdar8875247 f;
-} // expected-warning{{non-void function does not return a value}}
-
 struct rdar8875247_B {
   rdar8875247_B();
   ~rdar8875247_B();
@@ -124,21 +120,12 @@ namespace PR10801 {
 }
 
 namespace GH63009 {
-struct S1 {
-  [[noreturn]] S1();
-};
-
 struct S2 {
   [[noreturn]] ~S2();
 };
 
 int foo();
 
-int test_1() {
-  S1 s1;
-  foo();
-}
-
 int test_2() {
   S2 s2;
   foo();

diff  --git a/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-add-assign.cpp b/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-add-assign.cpp
index 1484f7e9d36c2a..007b3a43a3d977 100644
--- a/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-add-assign.cpp
+++ b/clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-add-assign.cpp
@@ -46,7 +46,7 @@ void add_assign_test(unsigned int n, int *a, int y) {
   // CHECK-NOT: fix-it:"{{.*}}":{[[@LINE-1]]:5-[[@LINE-1]]:9}:"p = p.subspan("
 }
 
-int expr_test(unsigned x, int *q, int y) {
+void expr_test(unsigned x, int *q, int y) {
   char *p = new char[8];
   // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:9}:"std::span<char> "
   // CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:13-[[@LINE-2]]:13}:"{"

diff  --git a/clang/test/SemaObjC/return-noreturn.m b/clang/test/SemaObjC/return-noreturn.m
index c7735ca211e6d1..c7b611559d86fd 100644
--- a/clang/test/SemaObjC/return-noreturn.m
+++ b/clang/test/SemaObjC/return-noreturn.m
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 %s -fsyntax-only -fobjc-exceptions -verify -Wreturn-type -Wmissing-noreturn
+// RUN: %clang_cc1 %s -fsyntax-only -fobjc-exceptions -verify -Wreturn-type -Wmissing-noreturn -Werror=return-type
 
 id f(id self) {
-} // expected-warning {{non-void function does not return a value}}
+} // expected-error {{non-void function does not return a value}}
 
 id f2(id self) {
   @try {

diff  --git a/clang/test/SemaObjC/try-catch.m b/clang/test/SemaObjC/try-catch.m
index 0bea7a5150a498..1216b540a8d219 100644
--- a/clang/test/SemaObjC/try-catch.m
+++ b/clang/test/SemaObjC/try-catch.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fobjc-exceptions -Werror=return-type %s
 typedef signed char BOOL;
 typedef struct _NSZone NSZone;
 
@@ -34,7 +34,7 @@ - (NSDictionary *)setUpInfoForTransformKey:(NSString *)transformKey outError:(NS
     @try {}
     // the exception name is optional (weird)
     @catch (NSException *) {}
-} // expected-warning {{non-void function does not return a value}}
+} // expected-error {{non-void function does not return a value}}
 
 - (NSDictionary *)anotherFunction {
     @try {}

diff  --git a/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp b/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp
index 0e654768787aae..90f4d3261c5a28 100644
--- a/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp
+++ b/clang/test/SemaTemplate/late-parsing-eager-instantiation.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++14 -verify %s
+// RUN: %clang_cc1 -Wno-error=return-type -std=c++14 -verify %s
 
 // pr33561
 class ArrayBuffer;

diff  --git a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
index 92ec79d126575a..5e1c12ba26d877 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -4329,7 +4329,7 @@ TEST_P(ASTMatchersTest, hasOperator) {
 TEST_P(ASTMatchersTest, IsMain) {
   EXPECT_TRUE(matches("int main() {}", functionDecl(isMain())));
 
-  EXPECT_TRUE(notMatches("int main2() {}", functionDecl(isMain())));
+  EXPECT_TRUE(notMatches("int main2() { return 0; }", functionDecl(isMain())));
 }
 
 TEST_P(ASTMatchersTest, OMPExecutableDirective_IsStandaloneDirective) {

diff  --git a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
index 75d6ca5ba17f8b..068cf667710279 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -665,6 +665,7 @@ void check_match_co_return() {
 #include <coro_header>
 void check_match_co_await() {
   co_await a;
+  co_return 1;
 }
 )cpp";
   EXPECT_TRUE(matchesConditionally(CoAwaitCode,
@@ -674,6 +675,7 @@ void check_match_co_await() {
 #include <coro_header>
 void check_match_co_yield() {
   co_yield 1.0;
+  co_return 1;
 }
 )cpp";
   EXPECT_TRUE(matchesConditionally(CoYieldCode,
@@ -714,7 +716,7 @@ void coro() {
 void coro() try {
   int thevar;
   co_return 1;
-} catch (...) {}
+} catch (...) { co_return 1; }
 )cpp";
   EXPECT_TRUE(matchesConditionally(
       CoroWithTryCatchDeclCode,

diff  --git a/clang/unittests/Tooling/ASTSelectionTest.cpp b/clang/unittests/Tooling/ASTSelectionTest.cpp
index 1897bc15196ec2..0f60749725cde9 100644
--- a/clang/unittests/Tooling/ASTSelectionTest.cpp
+++ b/clang/unittests/Tooling/ASTSelectionTest.cpp
@@ -384,7 +384,7 @@ TEST(ASTSelectionFinder, SelectionInFunctionInObjCImplementation) {
 @end
 @implementation I
 
-int notSelected() { }
+int notSelected() { return 0; }
 
 int selected(int x) {
   return x;

diff  --git a/clang/unittests/Tooling/LexicallyOrderedRecursiveASTVisitorTest.cpp b/clang/unittests/Tooling/LexicallyOrderedRecursiveASTVisitorTest.cpp
index b167eb4b811755..c0833dc4a640d8 100644
--- a/clang/unittests/Tooling/LexicallyOrderedRecursiveASTVisitorTest.cpp
+++ b/clang/unittests/Tooling/LexicallyOrderedRecursiveASTVisitorTest.cpp
@@ -107,7 +107,7 @@ TEST(LexicallyOrderedRecursiveASTVisitor, VisitDeclsInImplementation) {
 @end
 @implementation I
 
-int nestedFunction() { }
+void nestedFunction() { }
 
 - (void) method{ }
 

diff  --git a/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp b/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
index a551f83ff3f9c7..d58e190923a1f7 100644
--- a/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
+++ b/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
@@ -4604,7 +4604,7 @@ TEST_P(BuildSyntaxTreeTest, ConstructorCall_DefaultArguments) {
 struct X {
   X(int i = 1, char c = '2');
 };
-X test() {
+void test() {
   auto x0 = [[X()]];
   auto x1 = [[X(1)]];
   auto x2 = [[X(1, '2')]];


        


More information about the cfe-commits mailing list