[clang] 2ceee2f - Add -Wno-strict-prototypes to C tests; NFC
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 24 12:35:38 PST 2022
Author: Aaron Ballman
Date: 2022-02-24T15:30:30-05:00
New Revision: 2ceee2f8843f31fb6dab9f133e9b248b2eaa713a
URL: https://github.com/llvm/llvm-project/commit/2ceee2f8843f31fb6dab9f133e9b248b2eaa713a
DIFF: https://github.com/llvm/llvm-project/commit/2ceee2f8843f31fb6dab9f133e9b248b2eaa713a.diff
LOG: Add -Wno-strict-prototypes to C tests; NFC
This patch adds -Wno-strict-prototypes to all of the test cases that
use functions without prototypes, but not as the primary concern of the
test. e.g., attributes testing whether they can/cannot be applied to a
function without a prototype, etc.
This is done in preparation for enabling -Wstrict-prototypes by
default.
Added:
Modified:
clang/test/AST/ast-dump-decl-json.c
clang/test/AST/ast-dump-decl.c
clang/test/Analysis/blocks.m
clang/test/Analysis/casts.c
clang/test/Analysis/inline.c
clang/test/Analysis/malloc.c
clang/test/Analysis/misc-ps-region-store.m
clang/test/Analysis/misc-ps.m
clang/test/Analysis/null-deref-ps.c
clang/test/CodeGen/X86/x86_64-arguments.c
clang/test/CodeGen/attributes.c
clang/test/CodeGen/blocks.c
clang/test/CodeGen/call.c
clang/test/CodeGen/exceptions-strictfp.c
clang/test/CodeGen/exceptions.c
clang/test/CodeGen/exprs.c
clang/test/CodeGen/extend-arg-64.c
clang/test/CodeGen/functions.c
clang/test/CodeGen/incomplete-function-type.c
clang/test/CodeGen/inline.c
clang/test/CodeGen/inline2.c
clang/test/CodeGen/microsoft-call-conv-x64.c
clang/test/CodeGen/microsoft-call-conv.c
clang/test/CodeGen/ms-inline-asm-64.c
clang/test/CodeGen/sret.c
clang/test/CodeGen/stdcall-fastcall.c
clang/test/CodeGen/transparent-union-redecl.c
clang/test/CodeGen/unique-internal-linkage-names-dwarf.c
clang/test/CodeGen/ve-abi.c
clang/test/CodeGenCXX/funcsig.cpp
clang/test/CodeGenObjC/blocks.m
clang/test/Coverage/ast-printing.c
clang/test/Coverage/codegen.c
clang/test/Coverage/html-print.c
clang/test/Modules/malformed-overload.m
clang/test/OpenMP/declare_variant_clauses_messages.cpp
clang/test/OpenMP/declare_variant_messages.c
clang/test/PCH/types.c
clang/test/Parser/attributes.c
clang/test/Parser/c2x-attributes.c
clang/test/Sema/alias-redefinition.c
clang/test/Sema/alloc-size.c
clang/test/Sema/arm-cmse.c
clang/test/Sema/attr-alias-elf.c
clang/test/Sema/attr-c2x.c
clang/test/Sema/attr-cpuspecific.c
clang/test/Sema/attr-noreturn.c
clang/test/Sema/attr-ownership.c
clang/test/Sema/attr-swiftcall.c
clang/test/Sema/attr-target-mv.c
clang/test/Sema/attr-unused.c
clang/test/Sema/auto-type.c
clang/test/Sema/block-call.c
clang/test/Sema/block-misc.c
clang/test/Sema/builtin-assume-aligned.c
clang/test/Sema/builtin-dump-struct.c
clang/test/Sema/c89.c
clang/test/Sema/callingconv-iamcu.c
clang/test/Sema/callingconv.c
clang/test/Sema/constructor-attribute.c
clang/test/Sema/decl-microsoft-call-conv.c
clang/test/Sema/expr-address-of.c
clang/test/Sema/extern-redecl.c
clang/test/Sema/fp16-sema.c
clang/test/Sema/function-redecl.c
clang/test/Sema/function.c
clang/test/Sema/generic-selection.c
clang/test/Sema/implicit-builtin-decl.c
clang/test/Sema/implicit-int.c
clang/test/Sema/incomplete-call.c
clang/test/Sema/initialize-noreturn.c
clang/test/Sema/invalid-decl.c
clang/test/Sema/merge-decls.c
clang/test/Sema/ms_abi-sysv_abi.c
clang/test/Sema/nonnull.c
clang/test/Sema/overloadable.c
clang/test/Sema/predefined-function.c
clang/test/Sema/redefinition.c
clang/test/Sema/return.c
clang/test/Sema/sentinel-attribute.c
clang/test/Sema/sizeless-1.c
clang/test/Sema/static-array.c
clang/test/Sema/stdcall-fastcall-x64.c
clang/test/Sema/stdcall-fastcall.c
clang/test/Sema/type-spec-struct-union.c
clang/test/Sema/unused-expr.c
clang/test/SemaObjC/arc-decls.m
clang/test/SemaObjC/attr-swift_name.m
clang/test/SemaObjC/blocks.m
clang/test/SemaObjC/cocoa-api-usage.m.fixed
clang/test/SemaObjC/delay-parsing-cfunctions.m
clang/test/SemaObjC/externally-retained.m
clang/test/SemaObjC/protocol-archane.m
clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
Removed:
################################################################################
diff --git a/clang/test/AST/ast-dump-decl-json.c b/clang/test/AST/ast-dump-decl-json.c
index ad807dcbeb02..55b918afaab5 100644
--- a/clang/test/AST/ast-dump-decl-json.c
+++ b/clang/test/AST/ast-dump-decl-json.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-strict-prototypes -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
#include "Inputs/json-dump-include.h"
@@ -16,7 +16,7 @@ struct TestChildren {
};
};
-void testLabelDecl() {
+void testLabelDecl(void) {
__label__ TestLabelDecl;
TestLabelDecl: goto TestLabelDecl;
}
@@ -74,8 +74,8 @@ int TestFunctionDecl(int x, enum { e } y) {
int TestFunctionDecl2(enum Enum { e } x) { return x; }
int TestFunctionDeclProto(int x);
void TestFunctionDeclNoProto();
-extern int TestFunctionDeclSC();
-inline int TestFunctionDeclInline();
+extern int TestFunctionDeclSC(void);
+inline int TestFunctionDeclInline(void);
struct testFieldDecl {
int TestFieldDecl;
@@ -1574,14 +1574,14 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
// CHECK-NEXT: "offset": {{[0-9]+}},
-// CHECK-NEXT: "col": 31,
+// CHECK-NEXT: "col": 35,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDeclSC",
// CHECK-NEXT: "mangledName": "TestFunctionDeclSC",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int ()"
+// CHECK-NEXT: "qualType": "int (void)"
// CHECK-NEXT: },
// CHECK-NEXT: "storageClass": "extern"
// CHECK-NEXT: }
@@ -1604,14 +1604,14 @@ void testParmVarDecl(int TestParmVarDecl);
// CHECK-NEXT: },
// CHECK-NEXT: "end": {
// CHECK-NEXT: "offset": {{[0-9]+}},
-// CHECK-NEXT: "col": 35,
+// CHECK-NEXT: "col": 39,
// CHECK-NEXT: "tokLen": 1
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "name": "TestFunctionDeclInline",
// CHECK-NEXT: "mangledName": "TestFunctionDeclInline",
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "int ()"
+// CHECK-NEXT: "qualType": "int (void)"
// CHECK-NEXT: },
// CHECK-NEXT: "inline": true
// CHECK-NEXT: }
diff --git a/clang/test/AST/ast-dump-decl.c b/clang/test/AST/ast-dump-decl.c
index 4380877a410b..28b58c8eb648 100644
--- a/clang/test/AST/ast-dump-decl.c
+++ b/clang/test/AST/ast-dump-decl.c
@@ -1,19 +1,19 @@
// Test without serialization:
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump -ast-dump-filter Test %s \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-strict-prototypes -ast-dump -ast-dump-filter Test %s \
// RUN: | FileCheck --strict-whitespace %s
//
// Test with serialization:
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t %s
-// RUN: %clang_cc1 -x c -triple x86_64-unknown-unknown -include-pch %t \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-strict-prototypes -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-unknown-unknown -Wno-strict-prototypes -include-pch %t \
// RUN: -ast-dump-all -ast-dump-filter Test /dev/null \
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
// RUN: | FileCheck --strict-whitespace %s
//
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-strict-prototypes -ast-dump %s \
// RUN: | FileCheck -check-prefix CHECK-TU --strict-whitespace %s
//
// RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fmodule-name=X \
-// RUN: -triple x86_64-unknown-unknown -fmodule-map-file=%S/Inputs/module.modulemap \
+// RUN: -triple x86_64-unknown-unknown -Wno-strict-prototypes -fmodule-map-file=%S/Inputs/module.modulemap \
// RUN: -ast-dump -ast-dump-filter Test %s -DMODULES \
// RUN: | FileCheck -check-prefix CHECK -check-prefix CHECK-MODULES --strict-whitespace %s
@@ -43,7 +43,7 @@ struct TestChildren {
// CHECK-TU: TranslationUnitDecl
-void testLabelDecl() {
+void testLabelDecl(void) {
__label__ TestLabelDecl;
TestLabelDecl: goto TestLabelDecl;
}
@@ -147,11 +147,11 @@ int TestFunctionDeclProto(int x);
void TestFunctionDeclNoProto();
// CHECK: FunctionDecl{{.*}} TestFunctionDeclNoProto 'void ()'
-extern int TestFunctionDeclSC();
-// CHECK: FunctionDecl{{.*}} TestFunctionDeclSC 'int ()' extern
+extern int TestFunctionDeclSC(void);
+// CHECK: FunctionDecl{{.*}} TestFunctionDeclSC 'int (void)' extern
-inline int TestFunctionDeclInline();
-// CHECK: FunctionDecl{{.*}} TestFunctionDeclInline 'int ()' inline
+inline int TestFunctionDeclInline(void);
+// CHECK: FunctionDecl{{.*}} TestFunctionDeclInline 'int (void)' inline
struct testFieldDecl {
int TestFieldDecl;
diff --git a/clang/test/Analysis/blocks.m b/clang/test/Analysis/blocks.m
index 01b0ce6f02b9..9b2170718ab5 100644
--- a/clang/test/Analysis/blocks.m
+++ b/clang/test/Analysis/blocks.m
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify -Wno-strict-prototypes %s
// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core -analyzer-store=region -fblocks -analyzer-opt-analyze-nested-blocks -verify -x objective-c++ %s
//===----------------------------------------------------------------------===//
diff --git a/clang/test/Analysis/casts.c b/clang/test/Analysis/casts.c
index 28667b6a043a..afa3e1ae36ca 100644
--- a/clang/test/Analysis/casts.c
+++ b/clang/test/Analysis/casts.c
@@ -1,7 +1,7 @@
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -verify -analyzer-config eagerly-assume=false %s
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -verify -analyzer-config eagerly-assume=false %s
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -verify -DEAGERLY_ASSUME=1 -w %s
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -verify -DEAGERLY_ASSUME=1 -DBIT32=1 -w %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -analyzer-config eagerly-assume=false %s
+// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -analyzer-config eagerly-assume=false %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -DEAGERLY_ASSUME=1 -w %s
+// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -fenable-matrix -analyzer-checker=core,alpha.core,debug.ExprInspection -Wno-pointer-to-int-cast -Wno-strict-prototypes -verify -DEAGERLY_ASSUME=1 -DBIT32=1 -w %s
extern void clang_analyzer_eval(_Bool);
diff --git a/clang/test/Analysis/inline.c b/clang/test/Analysis/inline.c
index d0b154c05d91..b5db07ff41dd 100644
--- a/clang/test/Analysis/inline.c
+++ b/clang/test/Analysis/inline.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -Wno-strict-prototypes -verify %s
void clang_analyzer_eval(int);
void clang_analyzer_checkInlined(int);
diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c
index 63aed2fe98a4..daf5d7118628 100644
--- a/clang/test/Analysis/malloc.c
+++ b/clang/test/Analysis/malloc.c
@@ -1,4 +1,4 @@
-// RUN: %clang_analyze_cc1 -analyzer-store=region -verify %s \
+// RUN: %clang_analyze_cc1 -Wno-strict-prototypes -analyzer-store=region -verify %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=alpha.deadcode.UnreachableCode \
// RUN: -analyzer-checker=alpha.core.CastSize \
diff --git a/clang/test/Analysis/misc-ps-region-store.m b/clang/test/Analysis/misc-ps-region-store.m
index 706407ab279c..afe56bc65c19 100644
--- a/clang/test/Analysis/misc-ps-region-store.m
+++ b/clang/test/Analysis/misc-ps-region-store.m
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class %s
+// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class -Wno-strict-prototypes %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -DTEST_64 -analyzer-checker=core,alpha.core.CastToStruct,alpha.security.ReturnPtrRange,alpha.security.ArrayBound -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks -Wno-objc-root-class -Wno-strict-prototypes %s
typedef long unsigned int size_t;
void *memcpy(void *, const void *, size_t);
diff --git a/clang/test/Analysis/misc-ps.m b/clang/test/Analysis/misc-ps.m
index 3ac8dde3dd99..daf4489006e4 100644
--- a/clang/test/Analysis/misc-ps.m
+++ b/clang/test/Analysis/misc-ps.m
@@ -1,6 +1,6 @@
// NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued.
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s
-// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s
+// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -Wno-strict-prototypes -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -analyzer-store=region -Wno-strict-prototypes -Wno-pointer-to-int-cast -verify -fblocks -Wno-unreachable-code -Wno-null-dereference -Wno-objc-root-class %s
#ifndef __clang_analyzer__
#error __clang_analyzer__ not defined
diff --git a/clang/test/Analysis/null-deref-ps.c b/clang/test/Analysis/null-deref-ps.c
index 73e7ef066566..5c44c92bceb5 100644
--- a/clang/test/Analysis/null-deref-ps.c
+++ b/clang/test/Analysis/null-deref-ps.c
@@ -1,5 +1,5 @@
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -analyzer-purge=none -verify %s -Wno-error=return-type
-// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -verify %s -Wno-error=return-type
+// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-strict-prototypes -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -analyzer-purge=none -verify %s -Wno-error=return-type
+// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-strict-prototypes -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-store=region -verify %s -Wno-error=return-type
typedef unsigned uintptr_t;
diff --git a/clang/test/CodeGen/X86/x86_64-arguments.c b/clang/test/CodeGen/X86/x86_64-arguments.c
index d22c8f44b5f5..c07dda02c9c4 100644
--- a/clang/test/CodeGen/X86/x86_64-arguments.c
+++ b/clang/test/CodeGen/X86/x86_64-arguments.c
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s | \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -Wno-strict-prototypes -o - %s | \
// RUN: FileCheck %s -check-prefix=CHECK -check-prefix=SSE -check-prefix=NO-AVX512
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s -target-feature +avx | \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -Wno-strict-prototypes -o - %s -target-feature +avx | \
// RUN: FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=NO-AVX512
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -o - %s -target-feature +avx512f | \
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -debug-info-kind=limited -Wno-strict-prototypes -o - %s -target-feature +avx512f | \
// RUN: FileCheck %s -check-prefix=CHECK -check-prefix=AVX -check-prefix=AVX512
#include <stdarg.h>
diff --git a/clang/test/CodeGen/attributes.c b/clang/test/CodeGen/attributes.c
index ec42ff2f2c50..4ce2364ead2b 100644
--- a/clang/test/CodeGen/attributes.c
+++ b/clang/test/CodeGen/attributes.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -fcf-protection=branch -triple i386-linux-gnu %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -Wno-strict-prototypes -fcf-protection=branch -triple i386-linux-gnu %s -o - | FileCheck %s
// CHECK: @t5 = weak{{.*}} global i32 2
int t5 __attribute__((weak)) = 2;
diff --git a/clang/test/CodeGen/blocks.c b/clang/test/CodeGen/blocks.c
index 97236f1ab063..22a04425502a 100644
--- a/clang/test/CodeGen/blocks.c
+++ b/clang/test/CodeGen/blocks.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - -fblocks | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -Wno-strict-prototypes -o - -fblocks | FileCheck %s
// CHECK: %[[STRUCT_BLOCK_DESCRIPTOR:.*]] = type { i32, i32 }
diff --git a/clang/test/CodeGen/call.c b/clang/test/CodeGen/call.c
index 585e755e78d2..32ac4f8287c1 100644
--- a/clang/test/CodeGen/call.c
+++ b/clang/test/CodeGen/call.c
@@ -1,4 +1,4 @@
-// RUN: %clang %s -O0 -emit-llvm -S -o - | FileCheck %s
+// RUN: %clang %s -O0 -Wno-strict-prototypes -emit-llvm -S -o - | FileCheck %s
// This should call rb_define_global_function, not rb_f_chop.
void rb_define_global_function (const char*,void(*)(void),int);
diff --git a/clang/test/CodeGen/exceptions-strictfp.c b/clang/test/CodeGen/exceptions-strictfp.c
index 7d618a381d98..d110aa852343 100644
--- a/clang/test/CodeGen/exceptions-strictfp.c
+++ b/clang/test/CodeGen/exceptions-strictfp.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple armv7-apple-unknown -ffp-exception-behavior=strict -fexperimental-strict-floating-point -emit-llvm -o - %s -fexceptions -exception-model=sjlj -fblocks | FileCheck %s
+// RUN: %clang_cc1 -triple armv7-apple-unknown -Wno-strict-prototypes -ffp-exception-behavior=strict -fexperimental-strict-floating-point -emit-llvm -o - %s -fexceptions -exception-model=sjlj -fblocks | FileCheck %s
// Verify strictfp attributes on invoke calls (and therefore also on
// function definitions).
diff --git a/clang/test/CodeGen/exceptions.c b/clang/test/CodeGen/exceptions.c
index 92100f19df99..2170216a5140 100644
--- a/clang/test/CodeGen/exceptions.c
+++ b/clang/test/CodeGen/exceptions.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s -fexceptions -fblocks | FileCheck %s
-// RUN: %clang_cc1 -triple armv7-apple-unknown -emit-llvm -o - %s -fexceptions -exception-model=sjlj -fblocks | FileCheck %s -check-prefix=CHECK-ARM
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wno-strict-prototypes -emit-llvm -o - %s -fexceptions -fblocks | FileCheck %s
+// RUN: %clang_cc1 -triple armv7-apple-unknown -Wno-strict-prototypes -emit-llvm -o - %s -fexceptions -exception-model=sjlj -fblocks | FileCheck %s -check-prefix=CHECK-ARM
// rdar://problem/8621849
void test1(void) {
diff --git a/clang/test/CodeGen/exprs.c b/clang/test/CodeGen/exprs.c
index 5e1f3edc45b2..62b36f3d15a1 100644
--- a/clang/test/CodeGen/exprs.c
+++ b/clang/test/CodeGen/exprs.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -Wno-strict-prototypes -emit-llvm -o - | FileCheck %s
// PR1895
// sizeof function
diff --git a/clang/test/CodeGen/extend-arg-64.c b/clang/test/CodeGen/extend-arg-64.c
index dc26965418b2..11f1f9aa5bf6 100644
--- a/clang/test/CodeGen/extend-arg-64.c
+++ b/clang/test/CodeGen/extend-arg-64.c
@@ -1,24 +1,24 @@
// RUN: %clang_cc1 -DD128 -triple x86_64-apple-darwin -fextend-arguments=64 \
-// RUN: %s -emit-llvm -o - | FileCheck %s -check-prefix=CHECKEXT
+// RUN: -Wno-strict-prototypes %s -emit-llvm -o - | FileCheck %s -check-prefix=CHECKEXT
// When the option isn't selected, no effect
// RUN: %clang_cc1 -DD128 -triple x86_64-apple-darwin \
-// RUN: %s -emit-llvm -o - | FileCheck %s \
+// RUN: -Wno-strict-prototypes %s -emit-llvm -o - | FileCheck %s \
// RUN: --implicit-check-not "ext {{.*}}to i64"
// The option isn't supported on x86, no effect
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -fextend-arguments=64 \
-// RUN: %s -emit-llvm -o - | FileCheck %s \
+// RUN: -Wno-strict-prototypes %s -emit-llvm -o - | FileCheck %s \
// RUN: --implicit-check-not "ext {{.*}}to i64"
// The option isn't supported on ppc, no effect
// RUN: %clang_cc1 -triple ppc64le -fextend-arguments=64 \
-// RUN: %s -emit-llvm -o - | FileCheck %s \
+// RUN: -Wno-strict-prototypes %s -emit-llvm -o - | FileCheck %s \
// RUN: --implicit-check-not "ext {{.*}}to i64"
// The option isn't supported on ppc, no effect
// RUN: %clang_cc1 -DD128 -triple powerpc64-ibm-aix-xcoff -fextend-arguments=64 \
-// RUN: %s -emit-llvm -o - | FileCheck %s \
+// RUN: -Wno-strict-prototypes %s -emit-llvm -o - | FileCheck %s \
// RUN: --implicit-check-not "ext {{.*}}to i64"
diff --git a/clang/test/CodeGen/functions.c b/clang/test/CodeGen/functions.c
index 0731b6089612..2176023eab8f 100644
--- a/clang/test/CodeGen/functions.c
+++ b/clang/test/CodeGen/functions.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - -verify | FileCheck %s
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -Wno-strict-prototypes -emit-llvm -o - -verify | FileCheck %s
int g();
@@ -19,7 +19,7 @@ void test3(T f) {
int a(int);
int a() {return 1;}
-void f0() {}
+void f0(void) {}
// CHECK-LABEL: define{{.*}} void @f0()
void f1();
@@ -31,13 +31,13 @@ void f2(void) {
void f1() {}
// CHECK: define {{.*}} @f3{{\(\)|\(.*sret.*\)}}
-struct foo { int X, Y, Z; } f3() {
+struct foo { int X, Y, Z; } f3(void) {
while (1) {}
}
// PR4423 - This shouldn't crash in codegen
void f4() {}
-void f5() { f4(42); } //expected-warning {{too many arguments}}
+void f5(void) { f4(42); } //expected-warning {{too many arguments}}
// Qualifiers on parameter types shouldn't make a
diff erence.
static void f6(const float f, const float g) {
@@ -52,7 +52,7 @@ void f7(float f, float g) {
struct Incomplete;
void f8_callback(struct Incomplete);
void f8_user(void (*callback)(struct Incomplete));
-void f8_test() {
+void f8_test(void) {
f8_user(&f8_callback);
// CHECK-LABEL: define{{.*}} void @f8_test()
// CHECK: call void @f8_user({{.*}}* noundef bitcast (void ()* @f8_callback to {{.*}}*))
@@ -62,6 +62,6 @@ void f8_test() {
// PR10204: don't crash
static void test9_helper(void) {}
-void test9() {
+void test9(void) {
(void) test9_helper;
}
diff --git a/clang/test/CodeGen/incomplete-function-type.c b/clang/test/CodeGen/incomplete-function-type.c
index 0ec1cf871391..f5561d0677df 100644
--- a/clang/test/CodeGen/incomplete-function-type.c
+++ b/clang/test/CodeGen/incomplete-function-type.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -Wno-strict-prototypes -emit-llvm -o - %s | FileCheck %s
// CHECK: ModuleID
// CHECK: target triple = "
// CHECK-NOT: opaque
@@ -12,4 +12,4 @@ enum teste1 { TEST1 };
struct tests2 { int x,y,z,a,b,c,d,e,f,g; };
struct tests3 { float x; };
-void f0() {}
+void f0(void) {}
diff --git a/clang/test/CodeGen/inline.c b/clang/test/CodeGen/inline.c
index a9cd88cabd8a..523eeed4824e 100644
--- a/clang/test/CodeGen/inline.c
+++ b/clang/test/CodeGen/inline.c
@@ -1,8 +1,8 @@
// REQUIRES: x86-registered-target
//
// RUN: echo "GNU89 tests:"
-// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
-// RUN: %clang_cc1 %s -triple i386-unknown-unknown -fexperimental-new-pass-manager -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -Wno-strict-prototypes -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -Wno-strict-prototypes -fexperimental-new-pass-manager -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu89 | FileCheck %s --check-prefix=CHECK1
// CHECK1-LABEL: define{{.*}} i32 @foo()
// CHECK1-LABEL: define{{.*}} i32 @bar()
// CHECK1-LABEL: define{{.*}} void @unreferenced1()
@@ -24,8 +24,8 @@
// CHECK1-LABEL: define available_externally void @gnu_ei_inline()
// RUN: echo "C99 tests:"
-// RUN: %clang_cc1 %s -triple i386-unknown-unknown -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
-// RUN: %clang_cc1 %s -triple i386-unknown-unknown -fexperimental-new-pass-manager -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -Wno-strict-prototypes -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
+// RUN: %clang_cc1 %s -triple i386-unknown-unknown -Wno-strict-prototypes -fexperimental-new-pass-manager -O1 -disable-llvm-passes -emit-llvm -o - -std=gnu99 | FileCheck %s --check-prefix=CHECK2
// CHECK2-LABEL: define{{.*}} i32 @ei()
// CHECK2-LABEL: define{{.*}} i32 @bar()
// CHECK2-NOT: unreferenced1
@@ -58,8 +58,8 @@
// CHECK3-LABEL: define linkonce_odr noundef i32 @_Z2eiv()
// RUN: echo "MS C Mode tests:"
-// RUN: %clang_cc1 %s -triple i386-pc-win32 -O1 -disable-llvm-passes -emit-llvm -o - -std=c99 | FileCheck %s --check-prefix=CHECK4
-// RUN: %clang_cc1 %s -triple i386-pc-win32 -fexperimental-new-pass-manager -O1 -disable-llvm-passes -emit-llvm -o - -std=c99 | FileCheck %s --check-prefix=CHECK4
+// RUN: %clang_cc1 %s -triple i386-pc-win32 -Wno-strict-prototypes -O1 -disable-llvm-passes -emit-llvm -o - -std=c99 | FileCheck %s --check-prefix=CHECK4
+// RUN: %clang_cc1 %s -triple i386-pc-win32 -Wno-strict-prototypes -fexperimental-new-pass-manager -O1 -disable-llvm-passes -emit-llvm -o - -std=c99 | FileCheck %s --check-prefix=CHECK4
// CHECK4-NOT: define weak_odr void @_Exit(
// CHECK4-LABEL: define weak_odr dso_local i32 @ei()
// CHECK4-LABEL: define dso_local i32 @bar()
diff --git a/clang/test/CodeGen/inline2.c b/clang/test/CodeGen/inline2.c
index 2d8294cbbb28..b02e5df2bc69 100644
--- a/clang/test/CodeGen/inline2.c
+++ b/clang/test/CodeGen/inline2.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -O1 -fno-experimental-new-pass-manager -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-GNU89 %s
-// RUN: %clang_cc1 -O1 -fno-experimental-new-pass-manager -std=c99 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-C99 %s
+// RUN: %clang_cc1 -Wno-strict-prototypes -O1 -fno-experimental-new-pass-manager -std=gnu89 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-GNU89 %s
+// RUN: %clang_cc1 -Wno-strict-prototypes -O1 -fno-experimental-new-pass-manager -std=c99 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-C99 %s
// CHECK-GNU89-LABEL: define{{.*}} i32 @f0()
// CHECK-C99-LABEL: define{{.*}} i32 @f0()
@@ -61,7 +61,7 @@ extern inline int f9(void) { return 0; }
// CHECK-C99-LABEL: define{{.*}} i32 @fB()
-int test_all() {
+int test_all(void) {
return f0() + f1() + f2() + f3() + f4() + f5() + f6() + f7() + f8() + f9()
+ fA() + fB();
}
diff --git a/clang/test/CodeGen/microsoft-call-conv-x64.c b/clang/test/CodeGen/microsoft-call-conv-x64.c
index 6724d35f27c4..bcb9bc36832c 100644
--- a/clang/test/CodeGen/microsoft-call-conv-x64.c
+++ b/clang/test/CodeGen/microsoft-call-conv-x64.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-win32 -Wno-strict-prototypes -emit-llvm < %s | FileCheck %s
void __fastcall f1(void);
void __stdcall f2(void);
diff --git a/clang/test/CodeGen/microsoft-call-conv.c b/clang/test/CodeGen/microsoft-call-conv.c
index a94cbdb1a58d..763d443f8e86 100644
--- a/clang/test/CodeGen/microsoft-call-conv.c
+++ b/clang/test/CodeGen/microsoft-call-conv.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm < %s | FileCheck %s
-// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm -mrtd < %s | FileCheck %s
-// RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm -fms-compatibility < %s
+// RUN: %clang_cc1 -triple i386-pc-linux -Wno-strict-prototypes -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-linux -Wno-strict-prototypes -emit-llvm -mrtd < %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-pc-linux -Wno-strict-prototypes -emit-llvm -fms-compatibility < %s
void __fastcall f1(void);
void __stdcall f2(void);
diff --git a/clang/test/CodeGen/ms-inline-asm-64.c b/clang/test/CodeGen/ms-inline-asm-64.c
index 87c4af9aa1ed..bf3e0e91e19a 100644
--- a/clang/test/CodeGen/ms-inline-asm-64.c
+++ b/clang/test/CodeGen/ms-inline-asm-64.c
@@ -1,5 +1,5 @@
// REQUIRES: x86-registered-target
-// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -Wno-strict-prototypes -fasm-blocks -emit-llvm -o - | FileCheck %s
void t1(void) {
int var = 10;
diff --git a/clang/test/CodeGen/sret.c b/clang/test/CodeGen/sret.c
index 201e3b87f8b9..1ae83feb26ff 100644
--- a/clang/test/CodeGen/sret.c
+++ b/clang/test/CodeGen/sret.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | grep sret | grep -v 'sret.c' | count 4
+// RUN: %clang_cc1 %s -Wno-strict-prototypes -emit-llvm -o - | grep sret | grep -v 'sret.c' | count 4
struct abc {
long a;
@@ -11,7 +11,7 @@ struct abc {
struct abc foo1(void);
struct abc foo2();
-void bar() {
+void bar(void) {
struct abc dummy1 = foo1();
struct abc dummy2 = foo2();
}
diff --git a/clang/test/CodeGen/stdcall-fastcall.c b/clang/test/CodeGen/stdcall-fastcall.c
index dba1c185b8f0..086b3bafc97e 100644
--- a/clang/test/CodeGen/stdcall-fastcall.c
+++ b/clang/test/CodeGen/stdcall-fastcall.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -Wno-strict-prototypes -emit-llvm < %s | FileCheck %s
void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
diff --git a/clang/test/CodeGen/transparent-union-redecl.c b/clang/test/CodeGen/transparent-union-redecl.c
index dd1c0ae7ab1d..1955777991b5 100644
--- a/clang/test/CodeGen/transparent-union-redecl.c
+++ b/clang/test/CodeGen/transparent-union-redecl.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Werror -triple i386-linux -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Werror -triple i386-linux -Wno-strict-prototypes -emit-llvm -o - %s | FileCheck %s
// Test that
diff erent order of declarations is acceptable and that
// implementing
diff erent redeclarations is acceptable.
diff --git a/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c b/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c
index 4b7093a0713a..5a401182450a 100644
--- a/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c
+++ b/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c
@@ -1,11 +1,11 @@
// This test checks if C functions with internal linkage names are mangled
// and the module hash suffixes attached including emitting DW_AT_linkage_name.
//
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -dwarf-version=4 -emit-llvm -o - %s | FileCheck %s --check-prefix=PLAIN
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -dwarf-version=4 -funique-internal-linkage-names -emit-llvm -o - %s | FileCheck %s --check-prefix=UNIQUE
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=4 -emit-llvm -o - %s | FileCheck %s --check-prefix=PLAIN
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=4 -funique-internal-linkage-names -emit-llvm -o - %s | FileCheck %s --check-prefix=UNIQUE
//
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -dwarf-version=5 -emit-llvm -o - %s | FileCheck %s --check-prefix=PLAIN
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -dwarf-version=5 -funique-internal-linkage-names -emit-llvm -o - %s | FileCheck %s --check-prefix=UNIQUE
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=5 -emit-llvm -o - %s | FileCheck %s --check-prefix=PLAIN
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=5 -funique-internal-linkage-names -emit-llvm -o - %s | FileCheck %s --check-prefix=UNIQUE
static int glob;
// foo should be given a uniquefied name under -funique-internal-linkage-names.
diff --git a/clang/test/CodeGen/ve-abi.c b/clang/test/CodeGen/ve-abi.c
index d9a415f72da7..9183879db7a9 100644
--- a/clang/test/CodeGen/ve-abi.c
+++ b/clang/test/CodeGen/ve-abi.c
@@ -8,7 +8,7 @@
/// treated as VARARGS (in order to place arguments in both registers and
/// memory locations in the back end)
-// RUN: %clang_cc1 -triple ve-linux-gnu -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple ve-linux-gnu -emit-llvm -Wno-strict-prototypes %s -o - | FileCheck %s
// CHECK-LABEL: define{{.*}} signext i8 @fun_si8(i8 noundef signext %a, i8 noundef signext %b) #0 {
char fun_si8(char a, char b) {
diff --git a/clang/test/CodeGenCXX/funcsig.cpp b/clang/test/CodeGenCXX/funcsig.cpp
index 5328ff946206..9e0085075d60 100644
--- a/clang/test/CodeGenCXX/funcsig.cpp
+++ b/clang/test/CodeGenCXX/funcsig.cpp
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -triple i686-pc-win32 %s -fms-extensions -fno-rtti -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-CXX
-// RUN: %clang_cc1 -x c -triple i686-pc-win32 %s -fms-extensions -fno-rtti -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-C
+// RUN: %clang_cc1 -x c -Wno-strict-prototypes -triple i686-pc-win32 %s -fms-extensions -fno-rtti -emit-llvm -o - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-C
// Similar to predefined-expr.cpp, but not as exhaustive, since it's basically
// equivalent to __PRETTY_FUNCTION__.
diff --git a/clang/test/CodeGenObjC/blocks.m b/clang/test/CodeGenObjC/blocks.m
index 3c9ecf01a254..848a5c1a9127 100644
--- a/clang/test/CodeGenObjC/blocks.m
+++ b/clang/test/CodeGenObjC/blocks.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fblocks -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fblocks -Wno-strict-prototypes -o - %s | FileCheck %s
// CHECK: %[[STRUCT_BLOCK_DESCRIPTOR:.*]] = type { i32, i32 }
diff --git a/clang/test/Coverage/ast-printing.c b/clang/test/Coverage/ast-printing.c
index 0cdc6e588e71..49f52af5f701 100644
--- a/clang/test/Coverage/ast-printing.c
+++ b/clang/test/Coverage/ast-printing.c
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only %s
-// RUN: %clang_cc1 -ast-print %s -o %t.1.c
-// RUN: %clang_cc1 -ast-print %t.1.c -o %t.2.c
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes %s
+// RUN: %clang_cc1 -ast-print -Wno-strict-prototypes %s -o %t.1.c
+// RUN: %clang_cc1 -ast-print -Wno-strict-prototypes %t.1.c -o %t.2.c
// RUN:
diff %t.1.c %t.2.c
-// RUN: %clang_cc1 -ast-dump %s
-// RUN: %clang_cc1 -ast-dump-all %s
+// RUN: %clang_cc1 -ast-dump -Wno-strict-prototypes %s
+// RUN: %clang_cc1 -ast-dump-all -Wno-strict-prototypes %s
#include "c-language-features.inc"
diff --git a/clang/test/Coverage/codegen.c b/clang/test/Coverage/codegen.c
index 263e9b4c4e05..ab40ab8eede8 100644
--- a/clang/test/Coverage/codegen.c
+++ b/clang/test/Coverage/codegen.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o %t %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm-bc -o %t %s
-// RUN: %clang_cc1 -triple i386-unknown-unknown -debug-info-kind=limited -emit-llvm-bc -o %t %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm-bc -o %t %s
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -debug-info-kind=limited -emit-llvm-bc -o %t %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -Wno-strict-prototypes -emit-llvm -o %t %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -Wno-strict-prototypes -emit-llvm-bc -o %t %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -debug-info-kind=limited -Wno-strict-prototypes -emit-llvm-bc -o %t %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -Wno-strict-prototypes -emit-llvm-bc -o %t %s
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -debug-info-kind=limited -Wno-strict-prototypes -emit-llvm-bc -o %t %s
#include "c-language-features.inc"
diff --git a/clang/test/Coverage/html-print.c b/clang/test/Coverage/html-print.c
index a3f29c6f36f8..bc8e128b7859 100644
--- a/clang/test/Coverage/html-print.c
+++ b/clang/test/Coverage/html-print.c
@@ -1,3 +1,3 @@
-// RUN: %clang_cc1 -emit-html -o %t %s
+// RUN: %clang_cc1 -Wno-strict-prototypes -emit-html -o %t %s
#include "c-language-features.inc"
diff --git a/clang/test/Modules/malformed-overload.m b/clang/test/Modules/malformed-overload.m
index e080201d8e42..369de580c9d7 100644
--- a/clang/test/Modules/malformed-overload.m
+++ b/clang/test/Modules/malformed-overload.m
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs/malformed-overload -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -verify %s
+// RUN: %clang_cc1 -fsyntax-only -I%S/Inputs/malformed-overload -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Wno-strict-prototypes -verify %s
NSLog(@"%@", path); // expected-error {{expected parameter declarator}} expected-error {{expected ')'}} expected-warning {{type specifier missing}} expected-warning {{incompatible redeclaration}} expected-note {{to match this '('}} expected-note {{'NSLog' is a builtin with type}}
#import "X.h"
diff --git a/clang/test/OpenMP/declare_variant_clauses_messages.cpp b/clang/test/OpenMP/declare_variant_clauses_messages.cpp
index 5f63fa5eeb6d..63230fe473f0 100644
--- a/clang/test/OpenMP/declare_variant_clauses_messages.cpp
+++ b/clang/test/OpenMP/declare_variant_clauses_messages.cpp
@@ -2,9 +2,9 @@
// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux -fopenmp -fopenmp-version=51 -std=c++11 \
// RUN: -DNO_INTEROP_T_DEF -o - %s
// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux -fopenmp -fopenmp-version=50 -std=c++11 -o - %s
-// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux -fopenmp -fopenmp-version=51 -DC -x c -o - %s
+// RUN: %clang_cc1 -verify -triple x86_64-unknown-linux -fopenmp -fopenmp-version=51 -Wno-strict-prototypes -DC -x c -o - %s
// RUN: %clang_cc1 -verify -triple x86_64-pc-windows-msvc -fms-compatibility \
-// RUN: -fopenmp -fopenmp-version=51 -DC -DWIN -x c -o - %s
+// RUN: -fopenmp -fopenmp-version=51 -Wno-strict-prototypes -DC -DWIN -x c -o - %s
#ifdef NO_INTEROP_T_DEF
void foo_v1(float *, void *);
diff --git a/clang/test/OpenMP/declare_variant_messages.c b/clang/test/OpenMP/declare_variant_messages.c
index a049285cdb01..5618e1bbe1d3 100644
--- a/clang/test/OpenMP/declare_variant_messages.c
+++ b/clang/test/OpenMP/declare_variant_messages.c
@@ -1,6 +1,5 @@
-// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp -x c -std=c99 -fms-extensions -Wno-pragma-pack %s
-
-// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp-simd -x c -std=c99 -fms-extensions -Wno-pragma-pack %s
+// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp -std=c99 -fms-extensions -Wno-pragma-pack -Wno-strict-prototypes %s
+// RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp-simd -std=c99 -fms-extensions -Wno-pragma-pack -Wno-strict-prototypes %s
#pragma omp declare // expected-error {{expected an OpenMP directive}}
diff --git a/clang/test/PCH/types.c b/clang/test/PCH/types.c
index fc37a9c33d05..45f71611175e 100644
--- a/clang/test/PCH/types.c
+++ b/clang/test/PCH/types.c
@@ -1,9 +1,9 @@
// Test this without pch.
-// RUN: %clang_cc1 -fblocks -include %S/types.h -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fblocks -include %S/types.h -fsyntax-only -verify -Wno-strict-prototypes %s
// Test with pch.
-// RUN: %clang_cc1 -emit-pch -fblocks -o %t %S/types.h
-// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify %s -ast-print
+// RUN: %clang_cc1 -emit-pch -fblocks -Wno-strict-prototypes -o %t %S/types.h
+// RUN: %clang_cc1 -fblocks -include-pch %t -fsyntax-only -verify -Wno-strict-prototypes %s -ast-print
typedef int INT;
INT int_value;
diff --git a/clang/test/Parser/attributes.c b/clang/test/Parser/attributes.c
index 60cd50958e0e..bc7f826e67f6 100644
--- a/clang/test/Parser/attributes.c
+++ b/clang/test/Parser/attributes.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -pedantic -std=c99
+// RUN: %clang_cc1 -fsyntax-only -verify %s -pedantic -std=c99 -Wno-strict-prototypes
int __attribute__(()) x;
diff --git a/clang/test/Parser/c2x-attributes.c b/clang/test/Parser/c2x-attributes.c
index d75e9e2d2976..1e6e0a87a58f 100644
--- a/clang/test/Parser/c2x-attributes.c
+++ b/clang/test/Parser/c2x-attributes.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -fdouble-square-bracket-attributes -verify %s
-// RUN: %clang_cc1 -fsyntax-only -std=gnu2x -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fdouble-square-bracket-attributes -verify -Wno-strict-prototypes %s
+// RUN: %clang_cc1 -fsyntax-only -std=gnu2x -verify -Wno-strict-prototypes %s
enum [[]] E {
One [[]],
diff --git a/clang/test/Sema/alias-redefinition.c b/clang/test/Sema/alias-redefinition.c
index a4c06eebf499..526b67d9be7f 100644
--- a/clang/test/Sema/alias-redefinition.c
+++ b/clang/test/Sema/alias-redefinition.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -Wno-strict-prototypes -fsyntax-only -verify %s
void f0() {}
void fun0(void) __attribute((alias("f0")));
diff --git a/clang/test/Sema/alloc-size.c b/clang/test/Sema/alloc-size.c
index cd2673bd7ec7..93714894a630 100644
--- a/clang/test/Sema/alloc-size.c
+++ b/clang/test/Sema/alloc-size.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify
+// RUN: %clang_cc1 -Wno-strict-prototypes %s -verify
void *fail1(int a) __attribute__((alloc_size)); //expected-error{{'alloc_size' attribute takes at least 1 argument}}
void *fail2(int a) __attribute__((alloc_size())); //expected-error{{'alloc_size' attribute takes at least 1 argument}}
diff --git a/clang/test/Sema/arm-cmse.c b/clang/test/Sema/arm-cmse.c
index 2a32256aaf09..f27486fc4304 100644
--- a/clang/test/Sema/arm-cmse.c
+++ b/clang/test/Sema/arm-cmse.c
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -triple thumbv8m.base-none-eabi -mcmse -verify %s
+// RUN: %clang_cc1 -triple thumbv8m.base-none-eabi -mcmse -Wno-strict-prototypes -verify %s
-typedef void (*callback_ns_1t)() __attribute__((cmse_nonsecure_call));
-typedef void (*callback_1t)();
-typedef void (*callback_ns_2t)() __attribute__((cmse_nonsecure_call));
-typedef void (*callback_2t)();
+typedef void (*callback_ns_1t)(void) __attribute__((cmse_nonsecure_call));
+typedef void (*callback_1t)(void);
+typedef void (*callback_ns_2t)(void) __attribute__((cmse_nonsecure_call));
+typedef void (*callback_2t)(void);
void foo(callback_ns_1t nsfptr, // expected-error{{functions may not be declared with 'cmse_nonsecure_call' attribute}}
callback_1t fptr) __attribute__((cmse_nonsecure_call))
@@ -14,7 +14,7 @@ void foo(callback_ns_1t nsfptr, // expected-error{{functions may not be declared
callback_ns_2t fp4 = nsfptr;
}
-static void bar() __attribute__((cmse_nonsecure_entry)) // expected-warning{{'cmse_nonsecure_entry' cannot be applied to functions with internal linkage}}
+static void bar(void) __attribute__((cmse_nonsecure_entry)) // expected-warning{{'cmse_nonsecure_entry' cannot be applied to functions with internal linkage}}
{
}
@@ -24,14 +24,14 @@ extern nonsecure_fn_t baz; // expected-error{{functions may not be declared with
int v0 __attribute__((cmse_nonsecure_call)); // expected-warning {{'cmse_nonsecure_call' only applies to function types; type here is 'int'}}
int v1 __attribute__((cmse_nonsecure_entry)); // expected-warning {{'cmse_nonsecure_entry' attribute only applies to functions}}
-void fn0() __attribute__((cmse_nonsecure_entry));
-void fn1() __attribute__((cmse_nonsecure_entry(1))); // expected-error {{'cmse_nonsecure_entry' attribute takes no arguments}}
+void fn0(void) __attribute__((cmse_nonsecure_entry));
+void fn1(void) __attribute__((cmse_nonsecure_entry(1))); // expected-error {{'cmse_nonsecure_entry' attribute takes no arguments}}
-typedef void (*fn2_t)() __attribute__((cmse_nonsecure_call("abc"))); // expected-error {{'cmse_nonsecure_call' attribute takes no argument}}
+typedef void (*fn2_t)(void) __attribute__((cmse_nonsecure_call("abc"))); // expected-error {{'cmse_nonsecure_call' attribute takes no argument}}
union U { unsigned n; char b[4]; } u;
-union U xyzzy() __attribute__((cmse_nonsecure_entry)) {
+union U xyzzy(void) __attribute__((cmse_nonsecure_entry)) {
return u; // expected-warning {{passing union across security boundary via return value may leak information}}
}
@@ -46,7 +46,7 @@ struct S {
};
} s;
-void qux() {
+void qux(void) {
fn2(1,
u); // expected-warning {{passing union across security boundary via parameter 1 may leak information}}
diff --git a/clang/test/Sema/attr-alias-elf.c b/clang/test/Sema/attr-alias-elf.c
index e56f23e4fa51..9fcd872f9ebd 100644
--- a/clang/test/Sema/attr-alias-elf.c
+++ b/clang/test/Sema/attr-alias-elf.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-pc-linux -fsyntax-only -verify -emit-llvm-only %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux -Wno-strict-prototypes -fsyntax-only -verify -emit-llvm-only %s
void f1(void) __attribute__((alias("g1")));
void g1(void) {
diff --git a/clang/test/Sema/attr-c2x.c b/clang/test/Sema/attr-c2x.c
index 9662220d383e..980dc93775ae 100644
--- a/clang/test/Sema/attr-c2x.c
+++ b/clang/test/Sema/attr-c2x.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c2x %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wno-strict-prototypes -fsyntax-only -verify -std=c2x %s
struct S {};
struct S * [[clang::address_space(1)]] Foo;
diff --git a/clang/test/Sema/attr-cpuspecific.c b/clang/test/Sema/attr-cpuspecific.c
index 07ca516c8ae0..67e4c579bcbc 100644
--- a/clang/test/Sema/attr-cpuspecific.c
+++ b/clang/test/Sema/attr-cpuspecific.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify %s -Wnonnull
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wno-strict-prototypes -fsyntax-only -verify %s -Wnonnull
void __attribute__((cpu_specific(ivybridge))) no_default(void);
void __attribute__((cpu_specific(sandybridge))) no_default(void);
diff --git a/clang/test/Sema/attr-noreturn.c b/clang/test/Sema/attr-noreturn.c
index 3d1e8d7f4079..c617c19ff33e 100644
--- a/clang/test/Sema/attr-noreturn.c
+++ b/clang/test/Sema/attr-noreturn.c
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -verify -fsyntax-only %s
+// RUN: %clang_cc1 -verify -Wno-strict-prototypes -fsyntax-only %s
static void (*fp0)(void) __attribute__((noreturn));
-void fatal();
+void fatal(void);
static void __attribute__((noreturn)) f0(void) {
fatal();
@@ -13,17 +13,17 @@ int f1() __attribute__((noreturn));
int g0 __attribute__((noreturn)); // expected-warning {{'noreturn' only applies to function types; type here is 'int'}}
-int f2() __attribute__((noreturn(1, 2))); // expected-error {{'noreturn' attribute takes no arguments}}
+int f2(void) __attribute__((noreturn(1, 2))); // expected-error {{'noreturn' attribute takes no arguments}}
-void f3() __attribute__((noreturn));
-void f3() {
+void f3(void) __attribute__((noreturn));
+void f3(void) {
return; // expected-warning {{function 'f3' declared 'noreturn' should not return}}
}
#pragma clang diagnostic error "-Winvalid-noreturn"
-void f4() __attribute__((noreturn));
-void f4() {
+void f4(void) __attribute__((noreturn));
+void f4(void) {
return; // expected-error {{function 'f4' declared 'noreturn' should not return}}
}
diff --git a/clang/test/Sema/attr-ownership.c b/clang/test/Sema/attr-ownership.c
index 5ce758d9f4ad..8157ba7145a2 100644
--- a/clang/test/Sema/attr-ownership.c
+++ b/clang/test/Sema/attr-ownership.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only
+// RUN: %clang_cc1 %s -verify -fsyntax-only -Wno-strict-prototypes
void f1(void) __attribute__((ownership_takes("foo"))); // expected-error {{'ownership_takes' attribute requires parameter 1 to be an identifier}}
void *f2(void) __attribute__((ownership_returns(foo, 1, 2))); // expected-error {{'ownership_returns' attribute takes no more than 1 argument}}
diff --git a/clang/test/Sema/attr-swiftcall.c b/clang/test/Sema/attr-swiftcall.c
index 71f811f23883..b2606a05d198 100644
--- a/clang/test/Sema/attr-swiftcall.c
+++ b/clang/test/Sema/attr-swiftcall.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -triple x86_64-unknown-windows -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -Wno-strict-prototypes -verify %s
+// RUN: %clang_cc1 -triple x86_64-unknown-windows -fsyntax-only -Wno-strict-prototypes -verify %s
#define SWIFTCALL __attribute__((swiftcall))
#define SWIFTASYNCCALL __attribute__((swiftasynccall))
diff --git a/clang/test/Sema/attr-target-mv.c b/clang/test/Sema/attr-target-mv.c
index 3f072b19083f..174a3c8773e6 100644
--- a/clang/test/Sema/attr-target-mv.c
+++ b/clang/test/Sema/attr-target-mv.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wno-strict-prototypes -fsyntax-only -verify %s
void __attribute__((target("sse4.2"))) no_default(void);
void __attribute__((target("arch=sandybridge"))) no_default(void);
diff --git a/clang/test/Sema/attr-unused.c b/clang/test/Sema/attr-unused.c
index c0c7b9b97adb..49b90b5f50ea 100644
--- a/clang/test/Sema/attr-unused.c
+++ b/clang/test/Sema/attr-unused.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -fsyntax-only %s
+// RUN: %clang_cc1 -verify -Wunused -Wused-but-marked-unused -Wunused-parameter -Wunused -Wno-strict-prototypes -fsyntax-only %s
static void (*fp0)(void) __attribute__((unused));
@@ -9,14 +9,14 @@ int f1() __attribute__((unused));
int g0 __attribute__((unused));
-int f2() __attribute__((unused(1, 2))); // expected-error {{'unused' attribute takes no arguments}}
+int f2(void) __attribute__((unused(1, 2))); // expected-error {{'unused' attribute takes no arguments}}
struct Test0_unused {} __attribute__((unused));
struct Test0_not_unused {};
typedef int Int_unused __attribute__((unused));
typedef int Int_not_unused;
-void test0() {
+void test0(void) {
int x; // expected-warning {{unused variable}}
Int_not_unused i0; // expected-warning {{unused variable}}
diff --git a/clang/test/Sema/auto-type.c b/clang/test/Sema/auto-type.c
index ff7228785ac3..65f53f43dae7 100644
--- a/clang/test/Sema/auto-type.c
+++ b/clang/test/Sema/auto-type.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic -std=c11
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-strict-prototypes -verify -pedantic -std=c11
__auto_type a = 5; // expected-warning {{'__auto_type' is a GNU extension}}
__extension__ __auto_type a1 = 5;
diff --git a/clang/test/Sema/block-call.c b/clang/test/Sema/block-call.c
index 8dd5bd8f21b3..0b96c3bee5e3 100644
--- a/clang/test/Sema/block-call.c
+++ b/clang/test/Sema/block-call.c
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s -fblocks
int (*FP)();
int (^IFP) ();
int (^II) (int);
-int main() {
+int main(void) {
int (*FPL) (int) = FP; // C doesn't consider this an error.
// For Blocks, the ASTContext::typesAreBlockCompatible() makes sure this is an error.
@@ -40,7 +40,7 @@ int main() {
int (^z)() = a+4; // expected-error {{invalid block pointer conversion initializing 'int (^)()' with an expression of type 'int'}}
}
-int blah() {
+int blah(void) {
int (^IFP) (float);
char (^PCP)(double, double, char);
diff --git a/clang/test/Sema/block-misc.c b/clang/test/Sema/block-misc.c
index c57b3e141064..cce1e014b623 100644
--- a/clang/test/Sema/block-misc.c
+++ b/clang/test/Sema/block-misc.c
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks
-void donotwarn();
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s -fblocks
+void donotwarn(void);
int (^IFP) ();
int (^II) (int);
-int test1() {
+int test1(void) {
int (^PFR) (int) = 0; // OK
PFR = II; // OK
@@ -44,7 +44,7 @@ int test2(double (^S)()) {
int^ x; // expected-error {{block pointer to non-function type is invalid}}
int^^ x1; // expected-error {{block pointer to non-function type is invalid}} expected-error {{block pointer to non-function type is invalid}}
-void test3() {
+void test3(void) {
char *^ y; // expected-error {{block pointer to non-function type is invalid}}
}
@@ -72,7 +72,7 @@ void test5() {
}
// rdar://6405429 - __func__ in a block refers to the containing function name.
-const char*test6() {
+const char*test6(void) {
return ^{
return __func__;
} ();
@@ -85,12 +85,12 @@ int test7(void (^p)()) {
}
-void test8() {
+void test8(void) {
somelabel:
^{ goto somelabel; }(); // expected-error {{use of undeclared label 'somelabel'}}
}
-void test9() {
+void test9(void) {
goto somelabel; // expected-error {{use of undeclared label 'somelabel'}}
^{ somelabel: ; }();
}
@@ -126,7 +126,7 @@ void *test13 = ^{
};
};
-void test14() {
+void test14(void) {
int X = 32;
static void *P = ^{ // expected-error {{initializer element is not a compile-time constant}}
@@ -143,7 +143,7 @@ void foo(long (^comp)()) { // expected-note{{passing argument to parameter 'comp
}
void (^test15f)(void);
-void test15() {
+void test15(void) {
foo(^{ return LESS; }); // expected-error {{incompatible block pointer types passing 'int (^)(void)' to parameter of type 'long (^)()'}}
}
@@ -159,7 +159,7 @@ void test16(__block int i) { // expected-error {{__block attribute not allowed,
void f();
-void test17() {
+void test17(void) {
void (^bp)(int);
void (*rp)(int);
void (^bp1)();
@@ -183,13 +183,13 @@ void test17() {
(void)(0 < bp); // expected-error {{invalid operands to binary expression}}
}
-void test18() {
+void test18(void) {
void (^const blockA)(void) = ^{ }; // expected-note {{variable 'blockA' declared const here}}
blockA = ^{ }; // expected-error {{cannot assign to variable 'blockA' with const-qualified type 'void (^const)(void)}}
}
// rdar://7072507
-int test19() {
+int test19(void) {
goto L0; // expected-error {{cannot jump}}
__block int x; // expected-note {{jump bypasses setup of __block variable}}
@@ -200,7 +200,7 @@ int test19() {
}
// radr://7438948
-void test20() {
+void test20(void) {
int n = 7;
int vla[n]; // expected-note {{declared here}}
int (*vm)[n] = 0; // expected-note {{declared here}}
@@ -212,7 +212,7 @@ void test20() {
}
// radr://7438948
-void test21() {
+void test21(void) {
int a[7]; // expected-note {{declared here}}
__block int b[10]; // expected-note {{declared here}}
a[1] = 1;
diff --git a/clang/test/Sema/builtin-assume-aligned.c b/clang/test/Sema/builtin-assume-aligned.c
index cbe9e3a8caad..3dfe7955af21 100644
--- a/clang/test/Sema/builtin-assume-aligned.c
+++ b/clang/test/Sema/builtin-assume-aligned.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -DSIZE_T_64 -fsyntax-only -triple x86_64-linux -verify %s
-// RUN: %clang_cc1 -fsyntax-only -triple i386-freebsd -verify %s
+// RUN: %clang_cc1 -DSIZE_T_64 -fsyntax-only -Wno-strict-prototypes -triple x86_64-linux -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -triple i386-freebsd -verify %s
// __builtin_assume_aligned's second parameter is size_t, which may be 32 bits,
// so test
diff erently when size_t is 32 bits and when it is 64 bits.
diff --git a/clang/test/Sema/builtin-dump-struct.c b/clang/test/Sema/builtin-dump-struct.c
index ec82ad15b644..d898bac4103b 100644
--- a/clang/test/Sema/builtin-dump-struct.c
+++ b/clang/test/Sema/builtin-dump-struct.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -fno-spell-checking -verify %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -fno-spell-checking -Wno-strict-prototypes -verify %s
-void invalid_uses() {
+void invalid_uses(void) {
struct A {
};
struct A a;
@@ -25,7 +25,7 @@ void invalid_uses() {
__builtin_dump_struct(a, goodfunc); // expected-error {{passing 'struct A' to parameter of incompatible type structure pointer: type mismatch at 1st parameter ('struct A' vs structure pointer)}}
}
-void valid_uses() {
+void valid_uses(void) {
struct A {
};
union B {
diff --git a/clang/test/Sema/c89.c b/clang/test/Sema/c89.c
index 89eda9362608..210574c55091 100644
--- a/clang/test/Sema/c89.c
+++ b/clang/test/Sema/c89.c
@@ -1,6 +1,6 @@
-/* RUN: %clang_cc1 %s -std=c89 -pedantic -fsyntax-only -verify -Wimplicit-function-declaration
+/* RUN: %clang_cc1 %s -std=c89 -pedantic -fsyntax-only -verify -Wimplicit-function-declaration -Wno-strict-prototypes
*/
-void test1() {
+void test1(void) {
{
int i;
i = i + 1;
@@ -36,7 +36,7 @@ int *__restrict; /* expected-error {{expected identifier}} */
/* Implicit int, always ok */
-test6() { return 0; }
+test6(void) { return 0; }
/* PR2012 */
test7; /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
@@ -79,14 +79,14 @@ void test13b() {
}
/* Make sure we allow *test14 as a "function designator" */
-int test14() { return (&*test14)(); }
+int test14(void) { return (&*test14)(); }
int test15[5] = { [2] = 1 }; /* expected-warning {{designated initializers are a C99 feature}} */
extern int printf(__const char *__restrict __format, ...);
/* Warn, but don't suggest typo correction. */
-void test16() {
+void test16(void) {
printg("Hello, world!\n"); /* expected-warning {{implicit declaration of function 'printg'}} */
}
@@ -109,9 +109,9 @@ const array_of_CI mine2; /* expected-warning {{duplicate 'const' declaration spe
typedef CI *array_of_pointer_to_CI[5];
const array_of_pointer_to_CI mine3;
-void main() {} /* expected-error {{'main' must return 'int'}} */
+void main(void) {} /* expected-error {{'main' must return 'int'}} */
-const int main() {} /* expected-error {{'main' must return 'int'}} */
+const int main(void) {} /* expected-error {{'main' must return 'int'}} */
long long ll1 = /* expected-warning {{'long long' is an extension when C99 mode is not enabled}} */
-42LL; /* expected-warning {{'long long' is an extension when C99 mode is not enabled}} */
diff --git a/clang/test/Sema/callingconv-iamcu.c b/clang/test/Sema/callingconv-iamcu.c
index 248e98b0d01d..2874a8164545 100644
--- a/clang/test/Sema/callingconv-iamcu.c
+++ b/clang/test/Sema/callingconv-iamcu.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -triple i686-intel-elfiamcu -verify
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-strict-prototypes -triple i686-intel-elfiamcu -verify
void __attribute__((fastcall)) foo(float *a) { // expected-warning {{'fastcall' calling convention is not supported for this target}}
}
diff --git a/clang/test/Sema/callingconv.c b/clang/test/Sema/callingconv.c
index c2e3a61b1ee4..ed8e60bc6c0b 100644
--- a/clang/test/Sema/callingconv.c
+++ b/clang/test/Sema/callingconv.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -triple i386-unknown-unknown -verify
-// RUN: %clang_cc1 %s -fsyntax-only -triple i386-unknown-unknown -fms-compatibility -DWIN -verify
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-strict-prototypes -triple i386-unknown-unknown -verify
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-strict-prototypes -triple i386-unknown-unknown -fms-compatibility -DWIN -verify
void __attribute__((fastcall)) foo(float *a) {
}
diff --git a/clang/test/Sema/constructor-attribute.c b/clang/test/Sema/constructor-attribute.c
index 0615c63703a0..2317c7735bda 100644
--- a/clang/test/Sema/constructor-attribute.c
+++ b/clang/test/Sema/constructor-attribute.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-strict-prototypes %s
int x __attribute__((constructor)); // expected-warning {{'constructor' attribute only applies to functions}}
int f(void) __attribute__((constructor));
diff --git a/clang/test/Sema/decl-microsoft-call-conv.c b/clang/test/Sema/decl-microsoft-call-conv.c
index 5a83b38b192f..844d9b852581 100644
--- a/clang/test/Sema/decl-microsoft-call-conv.c
+++ b/clang/test/Sema/decl-microsoft-call-conv.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -verify %s
+// RUN: %clang_cc1 -triple i686-pc-win32 -Wno-strict-prototypes -verify %s
// It's important that this is a .c file.
diff --git a/clang/test/Sema/expr-address-of.c b/clang/test/Sema/expr-address-of.c
index 9ddf7dd40e4f..8881038b3241 100644
--- a/clang/test/Sema/expr-address-of.c
+++ b/clang/test/Sema/expr-address-of.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only
+// RUN: %clang_cc1 %s -verify -fsyntax-only -Wno-strict-prototypes
struct xx { int bitf:1; };
struct entry { struct xx *whatever;
diff --git a/clang/test/Sema/extern-redecl.c b/clang/test/Sema/extern-redecl.c
index bccf7ba38a6d..35373b7125e0 100644
--- a/clang/test/Sema/extern-redecl.c
+++ b/clang/test/Sema/extern-redecl.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-strict-prototypes %s
// rdar: // 8125274
static int a16[]; // expected-warning {{tentative array definition assumed to have one element}}
@@ -24,17 +24,17 @@ static int test1_a[]; // expected-warning {{tentative array definition assumed t
extern int test1_a[];
// rdar://13535367
-void test2declarer() { extern int test2_array[100]; }
+void test2declarer(void) { extern int test2_array[100]; }
extern int test2_array[];
int test2v = sizeof(test2_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int[]'}}
-void test3declarer() {
+void test3declarer(void) {
{ extern int test3_array[100]; }
extern int test3_array[];
int x = sizeof(test3_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int[]'}}
}
-void test4() {
+void test4(void) {
extern int test4_array[];
{
extern int test4_array[100];
@@ -46,24 +46,24 @@ void test4() {
// Test that invalid local extern declarations of library
// builtins behave reasonably.
extern void abort(void); // expected-note 2 {{previous declaration is here}}
-extern float *calloc(); // expected-warning {{incompatible redeclaration of library function}} expected-note {{is a builtin}} expected-note 2 {{previous declaration is here}}
-void test5a() {
- int abort(); // expected-error {{conflicting types}}
- float *malloc(); // expected-warning {{incompatible redeclaration of library function}} expected-note 2 {{is a builtin}}
- int *calloc(); // expected-error {{conflicting types}}
+extern float *calloc(void); // expected-warning {{incompatible redeclaration of library function}} expected-note {{is a builtin}} expected-note 2 {{previous declaration is here}}
+void test5a(void) {
+ int abort(void); // expected-error {{conflicting types}}
+ float *malloc(void); // expected-warning {{incompatible redeclaration of library function}} expected-note 2 {{is a builtin}}
+ int *calloc(void); // expected-error {{conflicting types}}
}
-void test5b() {
- int abort(); // expected-error {{conflicting types}}
- float *malloc(); // expected-warning {{incompatible redeclaration of library function}}
- int *calloc(); // expected-error {{conflicting types}}
+void test5b(void) {
+ int abort(void); // expected-error {{conflicting types}}
+ float *malloc(void); // expected-warning {{incompatible redeclaration of library function}}
+ int *calloc(void); // expected-error {{conflicting types}}
}
-void test5c() {
+void test5c(void) {
void (*_abort)(void) = &abort;
void *(*_malloc)() = &malloc;
float *(*_calloc)() = &calloc;
}
-void test6() {
+void test6(void) {
extern int test6_array1[100];
extern int test6_array2[100];
void test6_fn1(int*);
diff --git a/clang/test/Sema/fp16-sema.c b/clang/test/Sema/fp16-sema.c
index b0f6348a52a4..e403ba69e826 100644
--- a/clang/test/Sema/fp16-sema.c
+++ b/clang/test/Sema/fp16-sema.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s
// Functions cannot have parameters of type __fp16.
extern void f (__fp16); // expected-error {{parameters cannot have __fp16 type; did you forget * ?}}
diff --git a/clang/test/Sema/function-redecl.c b/clang/test/Sema/function-redecl.c
index eb6e78595ae5..d5da34a074bb 100644
--- a/clang/test/Sema/function-redecl.c
+++ b/clang/test/Sema/function-redecl.c
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wno-strict-prototypes -verify %s
// PR3588
void g0(int, int);
void g0(); // expected-note{{previous declaration is here}} expected-note{{'g0' declared here}}
-void f0() {
+void f0(void) {
g0(1, 2, 3); // expected-error{{too many arguments to function call}}
}
@@ -29,7 +29,7 @@ INT g2(x) // expected-error{{conflicting types for 'g2'}}
return x;
}
-void test() {
+void test(void) {
int f1;
{
void f1(double);
@@ -45,7 +45,7 @@ void test() {
extern void g3(int); // expected-note{{previous declaration is here}}
static void g3(int x) { } // expected-error{{static declaration of 'g3' follows non-static declaration}}
-void test2() {
+void test2(void) {
extern int f2; // expected-note 2 {{previous definition is here}}
{
void f2(int); // expected-error{{redefinition of 'f2' as
diff erent kind of symbol}}
@@ -66,7 +66,7 @@ int outer4(int); // expected-note{{previous declaration is here}}
int outer5; // expected-note{{previous definition is here}}
int *outer7(int);
-void outer_test() {
+void outer_test(void) {
int outer1(float); // expected-error{{conflicting types for 'outer1'}}
int outer2(int); // expected-note{{previous declaration is here}}
int outer3(int); // expected-note{{previous declaration is here}}
@@ -88,7 +88,7 @@ void outer_test2(int x) {
int *ip2 = outer7(x);
}
-void outer_test3() {
+void outer_test3(void) {
int *(*fp)(int) = outer8; // expected-error{{use of undeclared identifier 'outer8'}}
}
@@ -119,7 +119,7 @@ typedef int a();
typedef int a2(int*);
a x;
a2 x2; // expected-note{{passing argument to parameter here}}
-void test_x() {
+void test_x(void) {
x(5);
x2(5); // expected-warning{{incompatible integer to pointer conversion passing 'int' to parameter of type 'int *'}}
}
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 69262bb6f2cb..3140bfb95dc8 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -verify=c2x -pedantic
-// RUN: %clang_cc1 %s -fsyntax-only -std=c2x -verify -pedantic
+// RUN: %clang_cc1 %s -fsyntax-only -verify -verify=c2x -pedantic -Wno-strict-prototypes
// PR1892, PR11354
void f(double a[restrict][5]) { __typeof(a) x = 10; } // expected-warning {{(aka 'double (*restrict)[5]')}}
diff --git a/clang/test/Sema/generic-selection.c b/clang/test/Sema/generic-selection.c
index 36cfce4a950a..82d40afec8a5 100644
--- a/clang/test/Sema/generic-selection.c
+++ b/clang/test/Sema/generic-selection.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
-// RUN: %clang_cc1 -std=c99 -pedantic -fsyntax-only -verify=expected,ext %s
+// RUN: %clang_cc1 -std=c11 -fsyntax-only -Wno-strict-prototypes -verify %s
+// RUN: %clang_cc1 -std=c99 -pedantic -fsyntax-only -Wno-strict-prototypes -verify=expected,ext %s
void g(void);
diff --git a/clang/test/Sema/implicit-builtin-decl.c b/clang/test/Sema/implicit-builtin-decl.c
index 9434b507a3af..3a3b3ed7d47d 100644
--- a/clang/test/Sema/implicit-builtin-decl.c
+++ b/clang/test/Sema/implicit-builtin-decl.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s
void f() {
int *ptr = malloc(sizeof(int) * 10); // expected-warning{{implicitly declaring library function 'malloc' with type}} \
diff --git a/clang/test/Sema/implicit-int.c b/clang/test/Sema/implicit-int.c
index 3063db66ed85..361f0d38920f 100644
--- a/clang/test/Sema/implicit-int.c
+++ b/clang/test/Sema/implicit-int.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only %s -verify -pedantic
+// RUN: %clang_cc1 -fsyntax-only %s -verify -pedantic -Wno-strict-prototypes
-foo() { // expected-warning {{type specifier missing, defaults to 'int'}}
+foo(void) { // expected-warning {{type specifier missing, defaults to 'int'}}
return 0;
}
diff --git a/clang/test/Sema/incomplete-call.c b/clang/test/Sema/incomplete-call.c
index d34bda54986c..b095f7136787 100644
--- a/clang/test/Sema/incomplete-call.c
+++ b/clang/test/Sema/incomplete-call.c
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify %s
struct foo; // expected-note 3 {{forward declaration of 'struct foo'}}
-struct foo a(); // expected-note {{'a' declared here}}
+struct foo a(void); // expected-note {{'a' declared here}}
void b(struct foo);
void c();
diff --git a/clang/test/Sema/initialize-noreturn.c b/clang/test/Sema/initialize-noreturn.c
index 21ff29585ff9..4e0d845b9b4e 100644
--- a/clang/test/Sema/initialize-noreturn.c
+++ b/clang/test/Sema/initialize-noreturn.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-strict-prototypes -verify
// rdar://10095762
typedef void (*Fn_noret)(void) __attribute__((noreturn));
diff --git a/clang/test/Sema/invalid-decl.c b/clang/test/Sema/invalid-decl.c
index f0954b01b98b..08da9bca2d50 100644
--- a/clang/test/Sema/invalid-decl.c
+++ b/clang/test/Sema/invalid-decl.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-strict-prototypes -verify
-void test() {
+void test(void) {
char = 4; // expected-error {{expected identifier}}
}
@@ -35,7 +35,7 @@ static void bar(hid_t, char); // expected-error {{expected identifier}}
static void bar(hid_t p, char); // expected-error {{unknown type name 'hid_t'}}
-void foo() {
+void foo(void) {
(void)bar;
}
diff --git a/clang/test/Sema/merge-decls.c b/clang/test/Sema/merge-decls.c
index 3b27c04a3e25..5af8546106ba 100644
--- a/clang/test/Sema/merge-decls.c
+++ b/clang/test/Sema/merge-decls.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only
+// RUN: %clang_cc1 %s -verify -fsyntax-only -Wno-strict-prototypes
void foo(void);
void foo(void) {}
diff --git a/clang/test/Sema/ms_abi-sysv_abi.c b/clang/test/Sema/ms_abi-sysv_abi.c
index 35a5fad9ceb3..419553412dbf 100644
--- a/clang/test/Sema/ms_abi-sysv_abi.c
+++ b/clang/test/Sema/ms_abi-sysv_abi.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu %s
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu -Wno-strict-prototypes %s
// CC qualifier can be applied only to functions
int __attribute__((ms_abi)) var1; // expected-warning{{'ms_abi' only applies to function types; type here is 'int'}}
diff --git a/clang/test/Sema/nonnull.c b/clang/test/Sema/nonnull.c
index 3410d36ddfbc..40eeb11e0bf8 100644
--- a/clang/test/Sema/nonnull.c
+++ b/clang/test/Sema/nonnull.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-strict-prototypes %s
// rdar://9584012
//
// Verify All warnings are still issued with the option -fno-delete-null-pointer-checks
@@ -30,7 +30,7 @@ void baz(__attribute__((nonnull)) const char *str);
void baz2(__attribute__((nonnull(1))) const char *str); // expected-warning {{'nonnull' attribute when used on parameters takes no arguments}}
void baz3(__attribute__((nonnull)) int x); // expected-warning {{'nonnull' attribute only applies to pointer arguments}}
-void test_baz() {
+void test_baz(void) {
baz(0); // expected-warning {{null passed to a callee that requires a non-null argument}}
baz2(0); // no-warning
baz3(0); // no-warning
@@ -53,12 +53,12 @@ void *test_bad_returns_null(void) {
void PR18795(int (*g)(const char *h, ...) __attribute__((nonnull(1))) __attribute__((nonnull))) {
g(0); // expected-warning{{null passed to a callee that requires a non-null argument}}
}
-void PR18795_helper() {
+void PR18795_helper(void) {
PR18795(0); // expected-warning{{null passed to a callee that requires a non-null argument}}
}
void vararg1(int n, ...) __attribute__((nonnull(2)));
-void vararg1_test() {
+void vararg1_test(void) {
vararg1(0);
vararg1(1, (void*)0); // expected-warning{{null passed}}
vararg1(2, (void*)0, (void*)0); // expected-warning{{null passed}}
@@ -66,14 +66,14 @@ void vararg1_test() {
}
void vararg2(int n, ...) __attribute__((nonnull, nonnull, nonnull));
-void vararg2_test() {
+void vararg2_test(void) {
vararg2(0);
vararg2(1, (void*)0); // expected-warning{{null passed}}
vararg2(2, (void*)0, (void*)0); // expected-warning 2{{null passed}}
}
void vararg3(int n, ...) __attribute__((nonnull, nonnull(2), nonnull(3)));
-void vararg3_test() {
+void vararg3_test(void) {
vararg3(0);
vararg3(1, (void*)0); // expected-warning{{null passed}}
vararg3(2, (void*)0, (void*)0); // expected-warning 2{{null passed}}
@@ -127,8 +127,8 @@ int another_evil_nonnull_func(int* pointer, char ch, void * pv) {
}
extern void *returns_null(void**);
-extern void FOO();
-extern void FEE();
+extern void FOO(void);
+extern void FEE(void);
extern void *pv;
__attribute__((__nonnull__)) // expected-note {{declared 'nonnull' here}}
@@ -158,7 +158,7 @@ void pr21668_2(__attribute__((nonnull)) const char *p) {
;
}
-__attribute__((returns_nonnull)) void *returns_nonnull_whee(); // expected-note 6{{declared 'returns_nonnull' here}}
+__attribute__((returns_nonnull)) void *returns_nonnull_whee(void); // expected-note 6{{declared 'returns_nonnull' here}}
void returns_nonnull_warning_tests() {
if (returns_nonnull_whee() == NULL) {} // expected-warning {{comparison of nonnull function call 'returns_nonnull_whee()' equal to a null pointer is 'false' on first encounter}}
@@ -175,6 +175,6 @@ void returns_nonnull_warning_tests() {
void pr30828(char *p __attribute__((nonnull)));
void pr30828(char *p) {}
-void call_pr30828() {
+void call_pr30828(void) {
pr30828(0); // expected-warning {{null passed to a callee that requires a non-null argument}}
}
diff --git a/clang/test/Sema/overloadable.c b/clang/test/Sema/overloadable.c
index e9bbdeab7f66..7e52d67ea29e 100644
--- a/clang/test/Sema/overloadable.c
+++ b/clang/test/Sema/overloadable.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fdouble-square-bracket-attributes -verify %s -Wincompatible-pointer-types
+// RUN: %clang_cc1 -fsyntax-only -fdouble-square-bracket-attributes -verify %s -Wincompatible-pointer-types -Wno-strict-prototypes
int var __attribute__((overloadable)); // expected-error{{'overloadable' attribute only applies to functions}}
void bad_attr_target(int) [[clang::overloadable]]; // expected-error{{'overloadable' attribute cannot be applied to types}}
diff --git a/clang/test/Sema/predefined-function.c b/clang/test/Sema/predefined-function.c
index aa7b28535bcd..166c4661c904 100644
--- a/clang/test/Sema/predefined-function.c
+++ b/clang/test/Sema/predefined-function.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify -pedantic %s
char *funk(int format);
enum Test {A=-1};
diff --git a/clang/test/Sema/redefinition.c b/clang/test/Sema/redefinition.c
index 1ee35f7c36ee..a16556300ba7 100644
--- a/clang/test/Sema/redefinition.c
+++ b/clang/test/Sema/redefinition.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify
+// RUN: %clang_cc1 %s -fsyntax-only -verify -Wno-strict-prototypes
int f(int a) { return 0; } // expected-note {{previous definition is here}}
int f(int);
int f(int a) { return 0; } // expected-error {{redefinition of 'f'}}
diff --git a/clang/test/Sema/return.c b/clang/test/Sema/return.c
index 632d3430c30a..fc7d711b8ad8 100644
--- a/clang/test/Sema/return.c
+++ b/clang/test/Sema/return.c
@@ -1,112 +1,112 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -verify -fblocks -Wno-unreachable-code -Wno-unused-value -Wno-strict-prototypes
// clang emits the following warning by default.
// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the
// following warning.
-int t14() {
+int t14(void) {
return; // expected-warning {{non-void function 't14' should return a value}}
}
-void t15() {
+void t15(void) {
return 1; // expected-warning {{void function 't15' should not return a value}}
}
-int unknown();
+int unknown(void);
-void test0() {
+void test0(void) {
}
-int test1() {
+int test1(void) {
} // expected-warning {{non-void function does not return a value}}
-int test2() {
+int test2(void) {
a: goto a;
}
-int test3() {
+int test3(void) {
goto a;
a: ;
} // expected-warning {{non-void function does not return a value}}
-void halt() {
+void halt(void) {
a: goto a;
}
-void halt2() __attribute__((noreturn));
+void halt2(void) __attribute__((noreturn));
-int test4() {
+int test4(void) {
halt2();
}
-int test5() {
+int test5(void) {
halt2(), (void)1;
}
-int test6() {
+int test6(void) {
1, halt2();
}
int j;
-int unknown_nohalt() {
+int unknown_nohalt(void) {
return j;
}
-int test7() {
+int test7(void) {
unknown();
} // expected-warning {{non-void function does not return a value}}
-int test8() {
+int test8(void) {
(void)(1 + unknown());
} // expected-warning {{non-void function does not return a value}}
-int halt3() __attribute__((noreturn));
+int halt3(void) __attribute__((noreturn));
-int test9() {
+int test9(void) {
(void)(halt3() + unknown());
}
-int test10() {
+int test10(void) {
(void)(unknown() || halt3());
} // expected-warning {{non-void function does not return a value in all control paths}}
-int test11() {
+int test11(void) {
(void)(unknown() && halt3());
} // expected-warning {{non-void function does not return a value in all control paths}}
-int test12() {
+int test12(void) {
(void)(halt3() || unknown());
}
-int test13() {
+int test13(void) {
(void)(halt3() && unknown());
}
-int test14() {
+int test14(void) {
(void)(1 || unknown());
} // expected-warning {{non-void function does not return a value}}
-int test15() {
+int test15(void) {
(void)(0 || unknown());
} // expected-warning {{non-void function does not return a value}}
-int test16() {
+int test16(void) {
(void)(0 && unknown());
} // expected-warning {{non-void function does not return a value}}
-int test17() {
+int test17(void) {
(void)(1 && unknown());
} // expected-warning {{non-void function does not return a value}}
-int test18() {
+int test18(void) {
(void)(unknown_nohalt() && halt3());
} // expected-warning {{non-void function does not return a value in all control paths}}
-int test19() {
+int test19(void) {
(void)(unknown_nohalt() && unknown());
} // expected-warning {{non-void function does not return a value}}
-int test20() {
+int test20(void) {
int i;
if (i)
return 0;
@@ -114,7 +114,7 @@ int test20() {
return 2;
} // expected-warning {{non-void function does not return a value in all control paths}}
-int test21() {
+int test21(void) {
int i;
if (i)
return 0;
@@ -122,12 +122,12 @@ int test21() {
return 2;
}
-int test22() {
+int test22(void) {
int i;
switch (i) default: ;
} // expected-warning {{non-void function does not return a value}}
-int test23() {
+int test23(void) {
int i;
switch (i) {
case 0:
@@ -137,7 +137,7 @@ int test23() {
}
} // expected-warning {{non-void function does not return a value in all control paths}}
-int test24() {
+int test24(void) {
int i;
switch (i) {
case 0:
@@ -149,17 +149,17 @@ int test24() {
}
}
-int test25() {
+int test25(void) {
1 ? halt3() : unknown();
}
-int test26() {
+int test26(void) {
0 ? halt3() : unknown();
} // expected-warning {{non-void function does not return a value}}
int j;
-void (*fptr)() __attribute__((noreturn));
-int test27() {
+void (*fptr)(void) __attribute__((noreturn));
+int test27(void) {
switch (j) {
case 1:
do { } while (1);
@@ -193,7 +193,7 @@ void test28() __attribute__((noreturn));
void test28(x) { while (1) { } }
void exit(int);
-int test29() {
+int test29(void) {
exit(1);
}
@@ -205,7 +205,7 @@ extern void _longjmp (struct __jmp_buf_tag __env[1], int __val) __attribute__ ((
jmp_buf test30_j;
-int test30() {
+int test30(void) {
if (j)
longjmp(test30_j, 1);
else
@@ -219,21 +219,21 @@ int test30() {
typedef void test31_t(int status);
void test31(test31_t *callback __attribute__((noreturn)));
-void test32() {
+void test32(void) {
^ (void) { while (1) { } }();
^ (void) { if (j) while (1) { } }();
while (1) { }
}
-void test33() {
+void test33(void) {
if (j) while (1) { }
}
// Test that 'static inline' functions are only analyzed for CFG-based warnings
// when they are used.
-static inline int si_has_missing_return() {} // expected-warning{{non-void function does not return a value}}
-static inline int si_has_missing_return_2() {}; // expected-warning{{non-void function does not return a value}}
-static inline int si_forward();
+static inline int si_has_missing_return(void) {} // expected-warning{{non-void function does not return a value}}
+static inline int si_has_missing_return_2(void) {}; // expected-warning{{non-void function does not return a value}}
+static inline int si_forward(void);
static inline int si_has_missing_return_3(int x) {
if (x)
return si_has_missing_return_3(x+1);
@@ -243,17 +243,17 @@ int test_static_inline(int x) {
si_forward();
return x ? si_has_missing_return_2() : si_has_missing_return_3(x);
}
-static inline int si_forward() {} // expected-warning{{non-void function does not return a value}}
+static inline int si_forward(void) {} // expected-warning{{non-void function does not return a value}}
// Test warnings on ignored qualifiers on return types.
-const int ignored_c_quals(); // expected-warning{{'const' type qualifier on return type has no effect}}
-const volatile int ignored_cv_quals(); // expected-warning{{'const volatile' type qualifiers on return type have no effect}}
-char* const volatile restrict ignored_cvr_quals(); // expected-warning{{'const volatile restrict' type qualifiers on return type have no effect}}
+const int ignored_c_quals(void); // expected-warning{{'const' type qualifier on return type has no effect}}
+const volatile int ignored_cv_quals(void); // expected-warning{{'const volatile' type qualifiers on return type have no effect}}
+char* const volatile restrict ignored_cvr_quals(void); // expected-warning{{'const volatile restrict' type qualifiers on return type have no effect}}
typedef const int CI;
-CI ignored_quals_typedef();
+CI ignored_quals_typedef(void);
-const CI ignored_quals_typedef_2(); // expected-warning{{'const' type qualifier}}
+const CI ignored_quals_typedef_2(void); // expected-warning{{'const' type qualifier}}
// Test that for switch(enum) that if the switch statement covers all the cases
// that we don't consider that for -Wreturn-type.
@@ -277,7 +277,7 @@ int test34(int x) {
}
// PR18999
-int test35() {
+int test35(void) {
lbl:
if (1)
goto lbl;
@@ -322,14 +322,14 @@ int PR19074_positive(int x) {
} // expected-warning {{non-void function does not return a value in all control paths}}
// sizeof(long) test.
-int sizeof_long() {
+int sizeof_long(void) {
if (sizeof(long) == 4)
return 1;
if (sizeof(long) == 8)
return 2;
} // no-warning
-int return_statement_expression() {
+int return_statement_expression(void) {
if (unknown())
return ({
while (0)
diff --git a/clang/test/Sema/sentinel-attribute.c b/clang/test/Sema/sentinel-attribute.c
index 1beae87a51de..91db50222181 100644
--- a/clang/test/Sema/sentinel-attribute.c
+++ b/clang/test/Sema/sentinel-attribute.c
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: not %clang_cc1 -fsyntax-only %s -fdiagnostics-parseable-fixits 2>&1 | \
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-strict-prototypes %s
+// RUN: not %clang_cc1 -fsyntax-only -Wno-strict-prototypes %s -fdiagnostics-parseable-fixits 2>&1 | \
// RUN: FileCheck %s --check-prefix=C
-// RUN: not %clang_cc1 -fsyntax-only %s -fdiagnostics-parseable-fixits -x c++ -std=c++11 2>&1 | \
+// RUN: not %clang_cc1 -fsyntax-only -Wno-strict-prototypes %s -fdiagnostics-parseable-fixits -x c++ -std=c++11 2>&1 | \
// RUN: FileCheck %s --check-prefix=CXX11
int x __attribute__((sentinel)); //expected-warning{{'sentinel' attribute only applies to functions, methods and blocks}}
@@ -18,7 +18,7 @@ void f5(int a) __attribute__ ((sentinel)); //expected-warning{{'sentinel' attrib
void f6() __attribute__((__sentinel__)); // expected-warning {{'sentinel' attribute requires named arguments}}
-void g() {
+void g(void) {
// The integer literal zero is not a sentinel.
f1(1, 0); // expected-warning {{missing sentinel in function call}}
// C: fix-it:{{.*}}:{23:10-23:10}:", (void*) 0"
diff --git a/clang/test/Sema/sizeless-1.c b/clang/test/Sema/sizeless-1.c
index ad999052b0ee..8018a0753b3b 100644
--- a/clang/test/Sema/sizeless-1.c
+++ b/clang/test/Sema/sizeless-1.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-comment -triple arm64-linux-gnu -target-feature +sve -std=c90 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -triple arm64-linux-gnu -target-feature +sve -std=c11 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -triple arm64-linux-gnu -target-feature +sve -std=gnu11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-comment -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c90 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=c11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wall -W -Wno-strict-prototypes -triple arm64-linux-gnu -target-feature +sve -std=gnu11 %s
typedef __SVInt8_t svint8_t;
typedef __SVInt16_t svint16_t;
@@ -26,7 +26,7 @@ int alignof_int8_var_ptr = _Alignof(extern_int8_ptr); // expected-warning {{GNU
void pass_int8(svint8_t); // expected-note {{passing argument to parameter here}}
-svint8_t return_int8();
+svint8_t return_int8(void);
typedef svint8_t vec_int8_a __attribute__((vector_size(64))); // expected-error {{invalid vector element type}}
typedef svint8_t vec_int8_b __attribute__((ext_vector_type(4))); // expected-error {{invalid vector element type}}
@@ -45,7 +45,7 @@ void __attribute__((overloadable)) overf16(int); // expected-note + {{not
void noproto();
void varargs(int, ...);
-void unused() {
+void unused(void) {
svint8_t unused_int8; // expected-warning {{unused}}
}
diff --git a/clang/test/Sema/static-array.c b/clang/test/Sema/static-array.c
index ef070718dc63..87efb4894f1b 100644
--- a/clang/test/Sema/static-array.c
+++ b/clang/test/Sema/static-array.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 -fsyntax-only -fblocks -pedantic -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 -fsyntax-only -fblocks -pedantic -Wno-strict-prototypes -verify %s
void cat0(int a[static 0]) {} // expected-warning {{zero size arrays are an extension}} \
// expected-note {{callee declares array parameter as static here}}
diff --git a/clang/test/Sema/stdcall-fastcall-x64.c b/clang/test/Sema/stdcall-fastcall-x64.c
index 335da4169352..c5309b22c6b5 100644
--- a/clang/test/Sema/stdcall-fastcall-x64.c
+++ b/clang/test/Sema/stdcall-fastcall-x64.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-pc-linux-gnu %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify -triple x86_64-pc-linux-gnu %s
// CC qualifier can be applied only to functions
int __attribute__((stdcall)) var1; // expected-warning{{'stdcall' only applies to function types; type here is 'int'}}
diff --git a/clang/test/Sema/stdcall-fastcall.c b/clang/test/Sema/stdcall-fastcall.c
index 256f5588e6d2..1e3d8f7ab4a9 100644
--- a/clang/test/Sema/stdcall-fastcall.c
+++ b/clang/test/Sema/stdcall-fastcall.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -triple i686-apple-darwin10 %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-strict-prototypes -verify -triple i686-apple-darwin10 %s
// CC qualifier can be applied only to functions
int __attribute__((stdcall)) var1; // expected-warning{{'stdcall' only applies to function types; type here is 'int'}}
diff --git a/clang/test/Sema/type-spec-struct-union.c b/clang/test/Sema/type-spec-struct-union.c
index ce65095873ef..cfe115ea1ca4 100644
--- a/clang/test/Sema/type-spec-struct-union.c
+++ b/clang/test/Sema/type-spec-struct-union.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Wno-strict-prototypes -verify %s
/* This test checks the introduction of struct and union types based
on a type specifier of the form "struct-or-union identifier" when they
@@ -41,7 +41,7 @@ struct S6 {
enum { BAR } e;
};
-void test_S6() {
+void test_S6(void) {
struct S6 a;
a.e = BAR;
}
diff --git a/clang/test/Sema/unused-expr.c b/clang/test/Sema/unused-expr.c
index 01c5cf6316f9..af4f0f39b8e5 100644
--- a/clang/test/Sema/unused-expr.c
+++ b/clang/test/Sema/unused-expr.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-unreachable-code
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wno-unreachable-code -Wno-strict-prototypes
int foo(int X, int Y);
diff --git a/clang/test/SemaObjC/arc-decls.m b/clang/test/SemaObjC/arc-decls.m
index 93d7d941c1a0..e7366077d8fe 100644
--- a/clang/test/SemaObjC/arc-decls.m
+++ b/clang/test/SemaObjC/arc-decls.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -fblocks -fobjc-arc -verify -Wno-objc-root-class -Wno-strict-prototypes %s
// rdar://8843524
diff --git a/clang/test/SemaObjC/attr-swift_name.m b/clang/test/SemaObjC/attr-swift_name.m
index 6872b04cd5e9..a9580e77f460 100644
--- a/clang/test/SemaObjC/attr-swift_name.m
+++ b/clang/test/SemaObjC/attr-swift_name.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -fsyntax-only -fobjc-arc -fblocks %s
+// RUN: %clang_cc1 -verify -fsyntax-only -fobjc-arc -fblocks -Wno-strict-prototypes %s
#define SWIFT_NAME(name) __attribute__((__swift_name__(name)))
#define SWIFT_ASYNC_NAME(name) __attribute__((__swift_async_name__(name)))
diff --git a/clang/test/SemaObjC/blocks.m b/clang/test/SemaObjC/blocks.m
index e26fb3c0cd3f..4a13d1f06465 100644
--- a/clang/test/SemaObjC/blocks.m
+++ b/clang/test/SemaObjC/blocks.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify -fblocks %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify -fblocks -Wno-strict-prototypes %s
#define bool _Bool
@protocol NSObject;
diff --git a/clang/test/SemaObjC/cocoa-api-usage.m.fixed b/clang/test/SemaObjC/cocoa-api-usage.m.fixed
index f472cf1a3043..c02aeca8738d 100644
--- a/clang/test/SemaObjC/cocoa-api-usage.m.fixed
+++ b/clang/test/SemaObjC/cocoa-api-usage.m.fixed
@@ -76,7 +76,7 @@ typedef signed char BOOL;
#define PAIR(x) @#x, [NSNumber numberWithInt:(x)]
#define TWO(x) ((x), (x))
-void foo() {
+void foo(void) {
NSString *str = M(@"foo"); // expected-warning {{redundant}}
str = @"foo"; // expected-warning {{redundant}}
NSArray *arr = @[str]; // expected-warning {{redundant}}
diff --git a/clang/test/SemaObjC/delay-parsing-cfunctions.m b/clang/test/SemaObjC/delay-parsing-cfunctions.m
index bd578bf2555d..1cfa664956cd 100644
--- a/clang/test/SemaObjC/delay-parsing-cfunctions.m
+++ b/clang/test/SemaObjC/delay-parsing-cfunctions.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -Werror -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -Werror -verify -Wno-objc-root-class -Wno-strict-prototypes %s
// expected-no-diagnostics
// rdar://10387088
diff --git a/clang/test/SemaObjC/externally-retained.m b/clang/test/SemaObjC/externally-retained.m
index 6d983f4e423b..f89c6beee5bf 100644
--- a/clang/test/SemaObjC/externally-retained.m
+++ b/clang/test/SemaObjC/externally-retained.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fobjc-runtime=macosx-10.13.0 -fblocks -fobjc-arc %s -verify
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fobjc-runtime=macosx-10.13.0 -fblocks -fobjc-arc -Wno-strict-prototypes %s -verify
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -fobjc-runtime=macosx-10.13.0 -fblocks -fobjc-arc -xobjective-c++ %s -verify
#define EXT_RET __attribute__((objc_externally_retained))
diff --git a/clang/test/SemaObjC/protocol-archane.m b/clang/test/SemaObjC/protocol-archane.m
index f64e4aef9d51..0b1d0bffa9b7 100644
--- a/clang/test/SemaObjC/protocol-archane.m
+++ b/clang/test/SemaObjC/protocol-archane.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-pointer-to-int-cast -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-pointer-to-int-cast -Wno-objc-root-class -Wno-strict-prototypes %s
// rdar://5986251
@protocol SomeProtocol
diff --git a/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl b/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
index 9958c429ba1f..edfce02f2ea2 100644
--- a/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
+++ b/clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_pipes,+__opencl_c_generic_address_space,+__opencl_c_program_scope_global_variables
-// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=+__opencl_c_pipes,+__opencl_c_generic_address_space,-__opencl_c_program_scope_global_variables,-__opencl_c_device_enqueue
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-strict-prototypes -cl-std=CL2.0
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-strict-prototypes -cl-std=CL3.0 -cl-ext=+__opencl_c_pipes,+__opencl_c_generic_address_space,+__opencl_c_program_scope_global_variables
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -Wno-strict-prototypes -cl-std=CL3.0 -cl-ext=+__opencl_c_pipes,+__opencl_c_generic_address_space,-__opencl_c_program_scope_global_variables,-__opencl_c_device_enqueue
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++1.0
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++2021 -cl-ext=+__opencl_c_pipes,+__opencl_c_generic_address_space,+__opencl_c_program_scope_global_variables
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++2021 -cl-ext=+__opencl_c_pipes,+__opencl_c_generic_address_space,-__opencl_c_program_scope_global_variables,-__opencl_c_device_enqueue
More information about the cfe-commits
mailing list