From 46b0d0eef9e0a7290851cce0d44002b750584f1b Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 16 Feb 2022 16:09:36 -0500 Subject: [PATCH] Use functions with prototypes when appropriate; NFC A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the twelfth batch of tests being updated (the end may be in sight soon though). --- clang/test/CodeGen/target-builtin-noerror.c | 14 ++--- clang/test/CodeGen/target-features-error.c | 2 +- clang/test/CodeGen/target-features-no-error.c | 2 +- clang/test/CodeGen/tentative-decls.c | 8 +-- .../thinlto-clang-diagnostic-handler-in-be.c | 2 +- clang/test/CodeGen/thinlto-debug-pm.c | 2 +- clang/test/CodeGen/thinlto-emit-llvm.c | 2 +- clang/test/CodeGen/thinlto-inline-asm.c | 2 +- clang/test/CodeGen/thinlto-inline-asm2.c | 2 +- clang/test/CodeGen/thinlto-split-dwarf.c | 2 +- clang/test/CodeGen/thread-specifier.c | 6 +- clang/test/CodeGen/trapv.c | 6 +- clang/test/CodeGen/tsan-instrprof-atomic.c | 2 +- clang/test/CodeGen/typedef-func.c | 2 +- clang/test/CodeGen/types.c | 2 +- clang/test/CodeGen/ubsan-asan-noreturn.c | 2 +- clang/test/CodeGen/ubsan-conditional.c | 2 +- clang/test/CodeGen/ubsan-debuglog-return.c | 2 +- clang/test/CodeGen/ubsan-ignorelist-vfs.c | 4 +- clang/test/CodeGen/ubsan-ignorelist.c | 4 +- clang/test/CodeGen/ubsan-noreturn.c | 2 +- clang/test/CodeGen/ucn-identifiers.c | 2 +- clang/test/CodeGen/unaligned-expr.c | 6 +- clang/test/CodeGen/unaligned-memcpy.c | 2 +- clang/test/CodeGen/union.c | 6 +- .../CodeGen/unique-internal-linkage-names-dwarf.c | 2 +- clang/test/CodeGen/unreachable-ret.c | 6 +- clang/test/CodeGen/unreachable.c | 6 +- clang/test/CodeGen/unsigned-overflow-minimal.c | 6 +- clang/test/CodeGen/unsigned-overflow.c | 20 +++---- clang/test/CodeGen/unsigned-promotion.c | 2 +- clang/test/CodeGen/unsigned-trapv.c | 4 +- clang/test/CodeGen/unwind-attr.c | 2 +- clang/test/CodeGen/utf16-cfstrings.c | 2 +- clang/test/CodeGen/uwtable-attr.c | 2 +- clang/test/CodeGen/varargs.c | 4 +- clang/test/CodeGen/variable-array.c | 4 +- clang/test/CodeGen/ve-abi.c | 2 +- clang/test/CodeGen/vecshift.c | 2 +- clang/test/CodeGen/vector.c | 6 +- clang/test/CodeGen/vectorcall.c | 2 +- clang/test/CodeGen/vla-4.c | 20 +++---- clang/test/CodeGen/vla.c | 6 +- clang/test/CodeGen/vlt_to_pointer.c | 2 +- clang/test/CodeGen/volatile-1.c | 6 +- clang/test/CodeGen/volatile-2.c | 4 +- clang/test/CodeGen/volatile-complex.c | 8 +-- clang/test/CodeGen/volatile.c | 2 +- clang/test/CodeGen/whilestmt.c | 12 ++-- clang/test/CodeGen/win64-i128.c | 2 +- clang/test/CodeGen/windows-itanium.c | 2 +- .../CodeGen/windows-on-arm-dllimport-dllexport.c | 6 +- clang/test/CodeGen/windows-swiftcall.c | 4 +- clang/test/CodeGen/writable-strings.c | 2 +- clang/test/CodeGen/zero-call-used-regs.c | 20 +++---- clang/test/CodeGenObjC/2008-11-25-Blocks.m | 6 +- clang/test/CodeGenObjC/2009-02-05-VolatileProp.m | 2 +- clang/test/CodeGenObjC/arc-blocks-exceptions.m | 2 +- clang/test/CodeGenObjC/arc-blocks.m | 4 +- clang/test/CodeGenObjC/arc-bridged-cast.m | 2 +- .../arc-captured-32bit-block-var-layout-2.m | 14 ++--- .../arc-captured-32bit-block-var-layout.m | 64 +++++++++++----------- .../arc-captured-block-var-inlined-layout.m | 24 ++++---- .../CodeGenObjC/arc-captured-block-var-layout.m | 64 +++++++++++----------- clang/test/CodeGenObjC/arc-literals.m | 2 +- clang/test/CodeGenObjC/arc-no-runtime.m | 2 +- clang/test/CodeGenObjC/arc-precise-lifetime.m | 2 +- clang/test/CodeGenObjC/arc-rv-attr.m | 20 +++---- clang/test/CodeGenObjC/arc-unbridged-cast.m | 4 +- clang/test/CodeGenObjC/arc-unoptimized-byref-var.m | 2 +- clang/test/CodeGenObjC/arc-unsafeclaim.m | 20 +++---- clang/test/CodeGenObjC/arc-with-atthrow.m | 2 +- clang/test/CodeGenObjC/arc.m | 18 +++--- clang/test/CodeGenObjC/attr-noreturn.m | 4 +- .../CodeGenObjC/attr-speculative-load-hardening.m | 4 +- .../test/CodeGenObjC/availability-cf-link-guard.m | 2 +- .../CodeGenObjC/availability-check-maccatalyst.m | 2 +- clang/test/CodeGenObjC/availability-check.m | 2 +- clang/test/CodeGenObjC/block-6.m | 2 +- clang/test/CodeGenObjC/block-byref-debuginfo.m | 2 +- .../test/CodeGenObjC/block-byref-variable-layout.m | 10 ++-- clang/test/CodeGenObjC/block-ptr-type-crash.m | 2 +- clang/test/CodeGenObjC/block-var-layout.m | 28 +++++----- clang/test/CodeGenObjC/blocks-1.m | 4 +- clang/test/CodeGenObjC/blocks-2.m | 2 +- clang/test/CodeGenObjC/blocks-3.m | 4 +- clang/test/CodeGenObjC/blocks-4.m | 2 +- clang/test/CodeGenObjC/blocks-5.m | 2 +- clang/test/CodeGenObjC/boxing.m | 2 +- clang/test/CodeGenObjC/catch-lexical-block.m | 2 +- clang/test/CodeGenObjC/class-stubs.m | 2 +- clang/test/CodeGenObjC/constant-string-class.m | 2 +- .../convert-messages-to-runtime-calls.m | 12 ++-- clang/test/CodeGenObjC/debug-info-block-type.m | 2 +- clang/test/CodeGenObjC/debug-info-blocks.m | 2 +- clang/test/CodeGenObjC/debug-info-getter-name.m | 2 +- .../test/CodeGenObjC/debug-info-id-with-protocol.m | 2 +- clang/test/CodeGenObjC/debug-info-ivars-indirect.m | 6 +- .../CodeGenObjC/debug-info-property-accessors.m | 2 +- clang/test/CodeGenObjC/debug-property-synth.m | 2 +- clang/test/CodeGenObjC/dllstorage.m | 2 +- clang/test/CodeGenObjC/dot-syntax-1.m | 2 +- clang/test/CodeGenObjC/dot-syntax.m | 2 +- clang/test/CodeGenObjC/empty-collection-literals.m | 4 +- clang/test/CodeGenObjC/encode-test-2.m | 2 +- clang/test/CodeGenObjC/encode-test-3.m | 2 +- clang/test/CodeGenObjC/encode-test-4.m | 2 +- clang/test/CodeGenObjC/encode-test-6.m | 2 +- clang/test/CodeGenObjC/encode-test.m | 4 +- clang/test/CodeGenObjC/exceptions-asm-attribute.m | 2 +- clang/test/CodeGenObjC/exceptions-nonfragile.m | 6 +- clang/test/CodeGenObjC/exceptions.m | 10 ++-- .../CodeGenObjC/extended-block-signature-encode.m | 2 +- clang/test/CodeGenObjC/externally-retained.m | 8 +-- clang/test/CodeGenObjC/for-in.m | 4 +- .../forward-protocol-metadata-symbols.m | 2 +- clang/test/CodeGenObjC/fp2ret.m | 2 +- clang/test/CodeGenObjC/fpret.m | 2 +- clang/test/CodeGenObjC/fragile-arc.m | 2 +- .../test/CodeGenObjC/gnu-deterministic-selectors.m | 2 +- clang/test/CodeGenObjC/gnu-exceptions.m | 2 +- clang/test/CodeGenObjC/gnustep2-proto.m | 2 +- clang/test/CodeGenObjC/hidden-visibility.m | 2 +- clang/test/CodeGenObjC/id-isa-codegen.m | 2 +- .../test/CodeGenObjC/initialize-function-static.m | 2 +- clang/test/CodeGenObjC/ivar-type-encoding.m | 2 +- clang/test/CodeGenObjC/link-errors.m | 2 +- clang/test/CodeGenObjC/local-static-block.m | 6 +- clang/test/CodeGenObjC/metadata-symbols-32.m | 2 +- clang/test/CodeGenObjC/metadata_symbols.m | 2 +- clang/test/CodeGenObjC/mrc-weak.m | 4 +- .../mrr-captured-block-var-inlined-layout.m | 14 ++--- clang/test/CodeGenObjC/nested-rethrow.m | 2 +- clang/test/CodeGenObjC/no-sanitize.m | 2 +- clang/test/CodeGenObjC/noescape.m | 4 +- .../nontrivial-c-struct-within-struct-name.m | 4 +- clang/test/CodeGenObjC/ns-constant-strings.m | 2 +- clang/test/CodeGenObjC/objc-alloc-init.m | 2 +- .../CodeGenObjC/objc-arc-container-subscripting.m | 2 +- clang/test/CodeGenObjC/objc-asm-attribute-test.m | 2 +- clang/test/CodeGenObjC/objc-assign-ivar.m | 2 +- .../CodeGenObjC/objc-container-subscripting-1.m | 2 +- .../test/CodeGenObjC/objc-container-subscripting.m | 2 +- clang/test/CodeGenObjC/objc-dictionary-literal.m | 2 +- clang/test/CodeGenObjC/objc-fixed-enum.m | 2 +- .../test/CodeGenObjC/objc-literal-debugger-test.m | 2 +- clang/test/CodeGenObjC/objc-literal-tests.m | 4 +- clang/test/CodeGenObjC/objc-read-weak-byref.m | 2 +- clang/test/CodeGenObjC/objc2-assign-global.m | 2 +- .../test/CodeGenObjC/objc2-new-gc-api-strongcast.m | 2 +- .../CodeGenObjC/objc2-strong-cast-block-import.m | 2 +- clang/test/CodeGenObjC/objc2-weak-assign.m | 2 +- clang/test/CodeGenObjC/objc2-weak-compare.m | 2 +- .../test/CodeGenObjC/objc2-weak-import-attribute.m | 2 +- clang/test/CodeGenObjC/objc2-write-barrier.m | 4 +- clang/test/CodeGenObjC/object-incr-decr-1.m | 2 +- clang/test/CodeGenObjC/os_log.m | 10 ++-- clang/test/CodeGenObjC/property-agrr-getter.m | 2 +- .../test/CodeGenObjC/property-getter-dot-syntax.m | 2 +- clang/test/CodeGenObjC/property-incr-decr-1.m | 2 +- clang/test/CodeGenObjC/property-ref-cast-to-void.m | 2 +- clang/test/CodeGenObjC/property.m | 2 +- clang/test/CodeGenObjC/protocols-lazy.m | 4 +- clang/test/CodeGenObjC/protocols.m | 4 +- clang/test/CodeGenObjC/related-result-type.m | 4 +- clang/test/CodeGenObjC/stret.m | 2 +- clang/test/CodeGenObjC/strong-in-c-struct.m | 4 +- clang/test/CodeGenObjC/super-dotsyntax-property.m | 2 +- .../test/CodeGenObjC/tentative-cfconstantstring.m | 2 +- clang/test/CodeGenObjC/ubsan-bool.m | 2 +- .../CodeGenObjC/ubsan-nonnull-and-nullability.m | 4 +- clang/test/CodeGenObjC/ubsan-nullability.m | 6 +- clang/test/CodeGenObjC/unqual-copy-restore.m | 2 +- clang/test/CodeGenObjC/weak-metaclass-visibility.m | 2 +- 174 files changed, 420 insertions(+), 420 deletions(-) diff --git a/clang/test/CodeGen/target-builtin-noerror.c b/clang/test/CodeGen/target-builtin-noerror.c index 12d23ae..b1159ae 100644 --- a/clang/test/CodeGen/target-builtin-noerror.c +++ b/clang/test/CodeGen/target-builtin-noerror.c @@ -6,24 +6,24 @@ // No warnings. extern __m256i a; -int __attribute__((target("avx"))) bar() { +int __attribute__((target("avx"))) bar(void) { return _mm256_extract_epi32(a, 3); } -int baz() { +int baz(void) { return bar(); } -int __attribute__((target("avx"))) qq_avx() { +int __attribute__((target("avx"))) qq_avx(void) { return _mm256_extract_epi32(a, 3); } -int qq_noavx() { +int qq_noavx(void) { return 0; } extern __m256i a; -int qq() { +int qq(void) { if (__builtin_cpu_supports("avx")) return qq_avx(); else @@ -43,7 +43,7 @@ __m128 __attribute__((target("fma,fma4"))) fma_3(__m128 a, __m128 b, __m128 c) { return __builtin_ia32_vfmaddps(a, b, c); } -void verifyfeaturestrings() { +void verifyfeaturestrings(void) { (void)__builtin_cpu_supports("cmov"); (void)__builtin_cpu_supports("mmx"); (void)__builtin_cpu_supports("popcnt"); @@ -84,7 +84,7 @@ void verifyfeaturestrings() { (void)__builtin_cpu_supports("avx512vp2intersect"); } -void verifycpustrings() { +void verifycpustrings(void) { (void)__builtin_cpu_is("alderlake"); (void)__builtin_cpu_is("amd"); (void)__builtin_cpu_is("amdfam10h"); diff --git a/clang/test/CodeGen/target-features-error.c b/clang/test/CodeGen/target-features-error.c index a55163a9..97f217f 100644 --- a/clang/test/CodeGen/target-features-error.c +++ b/clang/test/CodeGen/target-features-error.c @@ -2,6 +2,6 @@ int __attribute__((target("avx"), always_inline)) foo(int a) { return a + 4; } -int bar() { +int bar(void) { return foo(4); // expected-error {{always_inline function 'foo' requires target feature 'avx', but would be inlined into function 'bar' that is compiled without support for 'avx'}} } diff --git a/clang/test/CodeGen/target-features-no-error.c b/clang/test/CodeGen/target-features-no-error.c index b6283b6..7eb39f3 100644 --- a/clang/test/CodeGen/target-features-no-error.c +++ b/clang/test/CodeGen/target-features-no-error.c @@ -4,6 +4,6 @@ int __attribute__((target("sse"), always_inline)) foo(int a) { return a + 4; } -int bar() { +int bar(void) { return foo(4); // expected-no-diagnostics } diff --git a/clang/test/CodeGen/tentative-decls.c b/clang/test/CodeGen/tentative-decls.c index e24c3fc..9453f15 100644 --- a/clang/test/CodeGen/tentative-decls.c +++ b/clang/test/CodeGen/tentative-decls.c @@ -11,7 +11,7 @@ struct s0 x; struct s0 y; // CHECK-DAG: @y = {{(dso_local )?}}global %struct.s0 zeroinitializer -struct s0 *f0() { +struct s0 *f0(void) { return &y; } @@ -21,7 +21,7 @@ struct s0 { // CHECK-DAG: @b = {{(dso_local )?}}global [1 x {{.*}}] zeroinitializer int b[]; -int *f1() { +int *f1(void) { return b; } @@ -33,6 +33,6 @@ int c[4]; // Check that we emit static tentative definitions // CHECK-DAG: @c5 = internal global [1 x {{.*}}] zeroinitializer static int c5[]; -static int func() { return c5[0]; } -int callfunc() { return func(); } +static int func(void) { return c5[0]; } +int callfunc(void) { return func(); } diff --git a/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c b/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c index 1223cd9..35bb7da 100644 --- a/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c +++ b/clang/test/CodeGen/thinlto-clang-diagnostic-handler-in-be.c @@ -10,7 +10,7 @@ // RUN: %clang -cc1 -triple x86_64-linux-gnu -O2 -fexperimental-new-pass-manager -x ir %t1.bo -fthinlto-index=%t.thinlto.bc -fprofile-instrument-use-path=%t2.profdata -emit-obj 2>&1 | FileCheck %s -allow-empty -check-prefix=CHECK-NOWARNING int sum; -__attribute__((noinline)) void bar() { +__attribute__((noinline)) void bar(void) { sum = 1234; } diff --git a/clang/test/CodeGen/thinlto-debug-pm.c b/clang/test/CodeGen/thinlto-debug-pm.c index b3a26acc2..6474c0e 100644 --- a/clang/test/CodeGen/thinlto-debug-pm.c +++ b/clang/test/CodeGen/thinlto-debug-pm.c @@ -13,5 +13,5 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-obj -O0 -o %t2.o -x ir %t.o -fthinlto-index=%t.thinlto.bc -fdebug-pass-manager 2>&1 | FileCheck %s --check-prefix=O0 // O0-NOT: Running pass: LoopVectorizePass -void foo() { +void foo(void) { } diff --git a/clang/test/CodeGen/thinlto-emit-llvm.c b/clang/test/CodeGen/thinlto-emit-llvm.c index dc46ae7..5bac703 100644 --- a/clang/test/CodeGen/thinlto-emit-llvm.c +++ b/clang/test/CodeGen/thinlto-emit-llvm.c @@ -8,5 +8,5 @@ // RUN: %clang_cc1 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -emit-llvm-bc -o - | llvm-dis -o - | FileCheck %s // CHECK: define{{.*}} void @foo() -void foo() { +void foo(void) { } diff --git a/clang/test/CodeGen/thinlto-inline-asm.c b/clang/test/CodeGen/thinlto-inline-asm.c index a41cba6..dbf90e7 100644 --- a/clang/test/CodeGen/thinlto-inline-asm.c +++ b/clang/test/CodeGen/thinlto-inline-asm.c @@ -13,7 +13,7 @@ // SYMTAB: D------X foo // SYMTAB: D------X bar -void foo() {} +void foo(void) {} asm(".globl bar \n" "bar: \n" diff --git a/clang/test/CodeGen/thinlto-inline-asm2.c b/clang/test/CodeGen/thinlto-inline-asm2.c index 30d8bfb..5d7bbc0 100644 --- a/clang/test/CodeGen/thinlto-inline-asm2.c +++ b/clang/test/CodeGen/thinlto-inline-asm2.c @@ -14,7 +14,7 @@ // NM-NOT: {{.}} // NM: ---------------- T ref // NM-NOT: {{.}} -const char *ref() { +const char *ref(void) { const char *ret; asm("lea ff_h264_cabac_tables(%%rip), %0" : "=r"(ret)); return ret; diff --git a/clang/test/CodeGen/thinlto-split-dwarf.c b/clang/test/CodeGen/thinlto-split-dwarf.c index 419bd13..b1db029 100644 --- a/clang/test/CodeGen/thinlto-split-dwarf.c +++ b/clang/test/CodeGen/thinlto-split-dwarf.c @@ -40,4 +40,4 @@ // DWARFv5-O-NOT: DW_TAG_subprogram // DWARFv5-DWO: DW_TAG_subprogram -int main() {} +int main(void) {} diff --git a/clang/test/CodeGen/thread-specifier.c b/clang/test/CodeGen/thread-specifier.c index 713ed37..18a14f9 100644 --- a/clang/test/CodeGen/thread-specifier.c +++ b/clang/test/CodeGen/thread-specifier.c @@ -17,8 +17,8 @@ __thread int a; extern __thread int b; -int c() { return *&b; } -int d() { +int c(void) { return *&b; } +int d(void) { __thread static int e; __thread static union {float a; int b;} f = {.b = 1}; return 0; @@ -29,7 +29,7 @@ __thread int h __attribute__((tls_model("local-dynamic"))); __thread int i __attribute__((tls_model("initial-exec"))); __thread int j __attribute__((tls_model("local-exec"))); -int f() { +int f(void) { __thread static int a __attribute__((tls_model("initial-exec"))); return a++; } diff --git a/clang/test/CodeGen/trapv.c b/clang/test/CodeGen/trapv.c index c01cafc..79a5218 100644 --- a/clang/test/CodeGen/trapv.c +++ b/clang/test/CodeGen/trapv.c @@ -4,7 +4,7 @@ unsigned int ui, uj, uk; int i, j, k; // CHECK-LABEL: define{{.*}} void @test0() -void test0() { +void test0(void) { // -ftrapv doesn't affect unsigned arithmetic. // CHECK: [[T1:%.*]] = load i32, i32* @uj // CHECK-NEXT: [[T2:%.*]] = load i32, i32* @uk @@ -24,7 +24,7 @@ void test0() { } // CHECK-LABEL: define{{.*}} void @test1() -void test1() { +void test1(void) { extern void opaque(int); opaque(i++); @@ -38,7 +38,7 @@ void test1() { } // CHECK-LABEL: define{{.*}} void @test2() -void test2() { +void test2(void) { extern void opaque(int); opaque(++i); diff --git a/clang/test/CodeGen/tsan-instrprof-atomic.c b/clang/test/CodeGen/tsan-instrprof-atomic.c index 48d3942..23402cf 100644 --- a/clang/test/CodeGen/tsan-instrprof-atomic.c +++ b/clang/test/CodeGen/tsan-instrprof-atomic.c @@ -3,4 +3,4 @@ // CHECK: define {{.*}}@foo // CHECK-NOT: load {{.*}}foo // CHECK: ret void -void foo() {} +void foo(void) {} diff --git a/clang/test/CodeGen/typedef-func.c b/clang/test/CodeGen/typedef-func.c index 1467e8b..0ceb968 100644 --- a/clang/test/CodeGen/typedef-func.c +++ b/clang/test/CodeGen/typedef-func.c @@ -10,7 +10,7 @@ filter_func_t mono_filter; void addfilter2(filter_func_t *func){} -void setup_filters() +void setup_filters(void) { addfilter2( mono_filter); } diff --git a/clang/test/CodeGen/types.c b/clang/test/CodeGen/types.c index 55b806c..a43e452 100644 --- a/clang/test/CodeGen/types.c +++ b/clang/test/CodeGen/types.c @@ -10,7 +10,7 @@ struct ieeeExternal { } *exthead; -void test1() +void test1(void) { struct ieeeExternal *exttmp = exthead; } diff --git a/clang/test/CodeGen/ubsan-asan-noreturn.c b/clang/test/CodeGen/ubsan-asan-noreturn.c index 7013328..2dd1bbf 100644 --- a/clang/test/CodeGen/ubsan-asan-noreturn.c +++ b/clang/test/CodeGen/ubsan-asan-noreturn.c @@ -6,7 +6,7 @@ void my_longjmp(void) __attribute__((noreturn)); // CHECK-LABEL: define{{.*}} void @calls_noreturn() -void calls_noreturn() { +void calls_noreturn(void) { my_longjmp(); // CHECK: @__asan_handle_no_return{{.*}} !nosanitize // CHECK-NEXT: @my_longjmp(){{[^#]*}} diff --git a/clang/test/CodeGen/ubsan-conditional.c b/clang/test/CodeGen/ubsan-conditional.c index 7f63b39..55c1bd6 100644 --- a/clang/test/CodeGen/ubsan-conditional.c +++ b/clang/test/CodeGen/ubsan-conditional.c @@ -2,7 +2,7 @@ _Bool b; // CHECK: @f( -double f() { +double f(void) { // CHECK: %[[B:.*]] = load {{.*}} @b // CHECK: %[[COND:.*]] = trunc {{.*}} %[[B]] to i1 // CHECK: br i1 %[[COND]] diff --git a/clang/test/CodeGen/ubsan-debuglog-return.c b/clang/test/CodeGen/ubsan-debuglog-return.c index 23a1326..7099650 100644 --- a/clang/test/CodeGen/ubsan-debuglog-return.c +++ b/clang/test/CodeGen/ubsan-debuglog-return.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -x c -debug-info-kind=line-tables-only -emit-llvm -fsanitize=returns-nonnull-attribute -o - %s | FileCheck %s // The UBSAN function call in the epilogue needs to have a debug location. -__attribute__((returns_nonnull)) void *allocate() {} +__attribute__((returns_nonnull)) void *allocate(void) {} // CHECK: define {{.*}}nonnull i8* @allocate(){{.*}} !dbg // CHECK: call void @__ubsan_handle_nonnull_return_v1_abort diff --git a/clang/test/CodeGen/ubsan-ignorelist-vfs.c b/clang/test/CodeGen/ubsan-ignorelist-vfs.c index 00450a7..b7ed577 100644 --- a/clang/test/CodeGen/ubsan-ignorelist-vfs.c +++ b/clang/test/CodeGen/ubsan-ignorelist-vfs.c @@ -18,7 +18,7 @@ unsigned i; // DEFAULT: @hash // FUNC: @hash // FILE: @hash -unsigned hash() { +unsigned hash(void) { // DEFAULT: call {{.*}}void @__ubsan // FUNC-NOT: call {{.*}}void @__ubsan // FILE-NOT: call {{.*}}void @__ubsan @@ -28,7 +28,7 @@ unsigned hash() { // DEFAULT: @add // FUNC: @add // FILE: @add -unsigned add() { +unsigned add(void) { // DEFAULT: call {{.*}}void @__ubsan // FUNC: call {{.*}}void @__ubsan // FILE-NOT: call {{.*}}void @__ubsan diff --git a/clang/test/CodeGen/ubsan-ignorelist.c b/clang/test/CodeGen/ubsan-ignorelist.c index 4fe84f8..409cb18 100644 --- a/clang/test/CodeGen/ubsan-ignorelist.c +++ b/clang/test/CodeGen/ubsan-ignorelist.c @@ -10,7 +10,7 @@ unsigned i; // DEFAULT: @hash // FUNC: @hash // FILE: @hash -unsigned hash() { +unsigned hash(void) { // DEFAULT: call {{.*}}void @__ubsan // FUNC-NOT: call {{.*}}void @__ubsan // FILE-NOT: call {{.*}}void @__ubsan @@ -20,7 +20,7 @@ unsigned hash() { // DEFAULT: @add // FUNC: @add // FILE: @add -unsigned add() { +unsigned add(void) { // DEFAULT: call {{.*}}void @__ubsan // FUNC: call {{.*}}void @__ubsan // FILE-NOT: call {{.*}}void @__ubsan diff --git a/clang/test/CodeGen/ubsan-noreturn.c b/clang/test/CodeGen/ubsan-noreturn.c index 7de24e0..fa88e55 100644 --- a/clang/test/CodeGen/ubsan-noreturn.c +++ b/clang/test/CodeGen/ubsan-noreturn.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 %s -emit-llvm -fsanitize=unreachable -o - | FileCheck %s // CHECK-LABEL: @f( -void __attribute__((noreturn)) f() { +void __attribute__((noreturn)) f(void) { // CHECK: __ubsan_handle_builtin_unreachable // CHECK: unreachable } diff --git a/clang/test/CodeGen/ucn-identifiers.c b/clang/test/CodeGen/ucn-identifiers.c index 56e3aa5..d33eab8 100644 --- a/clang/test/CodeGen/ucn-identifiers.c +++ b/clang/test/CodeGen/ucn-identifiers.c @@ -6,7 +6,7 @@ extern void \u00FCber(int); extern void \U000000FCber(int); // redeclaration, no warning -void goodCalls() { +void goodCalls(void) { \u00FCber(0); \u00fcber(1); über(2); diff --git a/clang/test/CodeGen/unaligned-expr.c b/clang/test/CodeGen/unaligned-expr.c index 6e23cbc..975dab2 100644 --- a/clang/test/CodeGen/unaligned-expr.c +++ b/clang/test/CodeGen/unaligned-expr.c @@ -109,7 +109,7 @@ void test10(void) { // -------- typedef __unaligned int UnalignedInt; -void test13() { +void test13(void) { // CHECK: %i = alloca i32, align 1 // CHECK: {{%.*}} = load i32, i32* %i, align 1 // CHECK: store i32 {{%.*}}, i32* %i, align 1 @@ -119,7 +119,7 @@ void test13() { typedef int Aligned; typedef __unaligned Aligned UnalignedInt2; -void test14() { +void test14(void) { // CHECK: %i = alloca i32, align 1 // CHECK: {{%.*}} = load i32, i32* %i, align 1 // CHECK: store i32 {{%.*}}, i32* %i, align 1 @@ -128,7 +128,7 @@ void test14() { } typedef UnalignedInt UnalignedInt3; -void test15() { +void test15(void) { // CHECK: %i = alloca i32, align 1 // CHECK: {{%.*}} = load i32, i32* %i, align 1 // CHECK: store i32 {{%.*}}, i32* %i, align 1 diff --git a/clang/test/CodeGen/unaligned-memcpy.c b/clang/test/CodeGen/unaligned-memcpy.c index 0373b56..d185748 100644 --- a/clang/test/CodeGen/unaligned-memcpy.c +++ b/clang/test/CodeGen/unaligned-memcpy.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -void bork() { +void bork(void) { char Qux[33] = {0}; } diff --git a/clang/test/CodeGen/union.c b/clang/test/CodeGen/union.c index 7302182..60e9e2d 100644 --- a/clang/test/CodeGen/union.c +++ b/clang/test/CodeGen/union.c @@ -5,7 +5,7 @@ union u_tag { float b; } u; -void f() { +void f(void) { u.b = 11; } @@ -29,12 +29,12 @@ int f3(value v) { enum E9 { one, two }; union S65 { enum E9 a; } ; union S65 s65; -void fS65() { enum E9 e = s65.a; } +void fS65(void) { enum E9 e = s65.a; } typedef union{ unsigned char x[65536]; } q; -int qfunc() {q buf; unsigned char* x = buf.x;} +int qfunc(void) {q buf; unsigned char* x = buf.x;} union RR {_Bool a : 1;} RRU; int RRF(void) {return RRU.a;} diff --git a/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c b/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c index 8ab3dcd..4b7093a 100644 --- a/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c +++ b/clang/test/CodeGen/unique-internal-linkage-names-dwarf.c @@ -19,7 +19,7 @@ static int bar(a) int a; return glob + a; } -void baz() { +void baz(void) { foo(); bar(1); } diff --git a/clang/test/CodeGen/unreachable-ret.c b/clang/test/CodeGen/unreachable-ret.c index 386b83e..1ddb40a 100644 --- a/clang/test/CodeGen/unreachable-ret.c +++ b/clang/test/CodeGen/unreachable-ret.c @@ -1,8 +1,8 @@ // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -extern void abort() __attribute__((noreturn)); +extern void abort(void) __attribute__((noreturn)); -void f1() { +void f1(void) { abort(); } // CHECK-LABEL: define {{.*}}void @f1() @@ -11,7 +11,7 @@ void f1() { // CHECK-NEXT: unreachable // CHECK-NEXT: } -void *f2() { +void *f2(void) { abort(); return 0; } diff --git a/clang/test/CodeGen/unreachable.c b/clang/test/CodeGen/unreachable.c index 898f64e6..66a5dbb 100644 --- a/clang/test/CodeGen/unreachable.c +++ b/clang/test/CodeGen/unreachable.c @@ -1,10 +1,10 @@ // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s // CHECK-NOT: @unreachable -extern void abort() __attribute__((noreturn)); -extern int unreachable(); +extern void abort(void) __attribute__((noreturn)); +extern int unreachable(void); -int f0() { +int f0(void) { return 0; unreachable(); } diff --git a/clang/test/CodeGen/unsigned-overflow-minimal.c b/clang/test/CodeGen/unsigned-overflow-minimal.c index 1998846..401f032 100644 --- a/clang/test/CodeGen/unsigned-overflow-minimal.c +++ b/clang/test/CodeGen/unsigned-overflow-minimal.c @@ -3,19 +3,19 @@ unsigned long li, lj, lk; // CHECK-LABEL: define{{.*}} void @testlongadd() -void testlongadd() { +void testlongadd(void) { // CHECK: call void @__ubsan_handle_add_overflow_minimal_abort() li = lj + lk; } // CHECK-LABEL: define{{.*}} void @testlongsub() -void testlongsub() { +void testlongsub(void) { // CHECK: call void @__ubsan_handle_sub_overflow_minimal_abort() li = lj - lk; } // CHECK-LABEL: define{{.*}} void @testlongmul() -void testlongmul() { +void testlongmul(void) { // CHECK: call void @__ubsan_handle_mul_overflow_minimal_abort() li = lj * lk; } diff --git a/clang/test/CodeGen/unsigned-overflow.c b/clang/test/CodeGen/unsigned-overflow.c index 88449cf..ff9ad5d 100644 --- a/clang/test/CodeGen/unsigned-overflow.c +++ b/clang/test/CodeGen/unsigned-overflow.c @@ -9,7 +9,7 @@ extern void opaquelong(unsigned long); extern void opaqueint(unsigned int); // CHECK-LABEL: define{{.*}} void @testlongadd() -void testlongadd() { +void testlongadd(void) { // CHECK: [[T1:%.*]] = load i64, i64* @lj // CHECK-NEXT: [[T2:%.*]] = load i64, i64* @lk @@ -21,7 +21,7 @@ void testlongadd() { } // CHECK-LABEL: define{{.*}} void @testlongsub() -void testlongsub() { +void testlongsub(void) { // CHECK: [[T1:%.*]] = load i64, i64* @lj // CHECK-NEXT: [[T2:%.*]] = load i64, i64* @lk @@ -33,7 +33,7 @@ void testlongsub() { } // CHECK-LABEL: define{{.*}} void @testlongmul() -void testlongmul() { +void testlongmul(void) { // CHECK: [[T1:%.*]] = load i64, i64* @lj // CHECK-NEXT: [[T2:%.*]] = load i64, i64* @lk @@ -45,7 +45,7 @@ void testlongmul() { } // CHECK-LABEL: define{{.*}} void @testlongpostinc() -void testlongpostinc() { +void testlongpostinc(void) { opaquelong(li++); // CHECK: [[T1:%.*]] = load i64, i64* @li @@ -56,7 +56,7 @@ void testlongpostinc() { } // CHECK-LABEL: define{{.*}} void @testlongpreinc() -void testlongpreinc() { +void testlongpreinc(void) { opaquelong(++li); // CHECK: [[T1:%.*]] = load i64, i64* @li @@ -67,7 +67,7 @@ void testlongpreinc() { } // CHECK-LABEL: define{{.*}} void @testintadd() -void testintadd() { +void testintadd(void) { // CHECK: [[T1:%.*]] = load i32, i32* @ij // CHECK-NEXT: [[T2:%.*]] = load i32, i32* @ik @@ -79,7 +79,7 @@ void testintadd() { } // CHECK-LABEL: define{{.*}} void @testintsub() -void testintsub() { +void testintsub(void) { // CHECK: [[T1:%.*]] = load i32, i32* @ij // CHECK-NEXT: [[T2:%.*]] = load i32, i32* @ik @@ -91,7 +91,7 @@ void testintsub() { } // CHECK-LABEL: define{{.*}} void @testintmul() -void testintmul() { +void testintmul(void) { // CHECK: [[T1:%.*]] = load i32, i32* @ij // CHECK-NEXT: [[T2:%.*]] = load i32, i32* @ik @@ -103,7 +103,7 @@ void testintmul() { } // CHECK-LABEL: define{{.*}} void @testintpostinc() -void testintpostinc() { +void testintpostinc(void) { opaqueint(ii++); // CHECK: [[T1:%.*]] = load i32, i32* @ii @@ -114,7 +114,7 @@ void testintpostinc() { } // CHECK-LABEL: define{{.*}} void @testintpreinc() -void testintpreinc() { +void testintpreinc(void) { opaqueint(++ii); // CHECK: [[T1:%.*]] = load i32, i32* @ii diff --git a/clang/test/CodeGen/unsigned-promotion.c b/clang/test/CodeGen/unsigned-promotion.c index eca0895..d58cad4 100644 --- a/clang/test/CodeGen/unsigned-promotion.c +++ b/clang/test/CodeGen/unsigned-promotion.c @@ -10,7 +10,7 @@ unsigned short si, sj, sk; // CHECKS-LABEL: define{{.*}} void @testshortmul() // CHECKU-LABEL: define{{.*}} void @testshortmul() -void testshortmul() { +void testshortmul(void) { // CHECKS: load i16, i16* @sj // CHECKS: load i16, i16* @sk diff --git a/clang/test/CodeGen/unsigned-trapv.c b/clang/test/CodeGen/unsigned-trapv.c index e129a12..62d5471 100644 --- a/clang/test/CodeGen/unsigned-trapv.c +++ b/clang/test/CodeGen/unsigned-trapv.c @@ -8,7 +8,7 @@ // UNSIGNED: @test_signed // TRAPV: @test_signed // BOTH: @test_signed -void test_signed() { +void test_signed(void) { extern volatile int a, b, c; // UNSIGNED: add nsw i32 // UNSIGNED-NOT: overflow @@ -24,7 +24,7 @@ void test_signed() { // UNSIGNED: @test_unsigned // TRAPV: @test_unsigned // BOTH: @test_unsigned -void test_unsigned() { +void test_unsigned(void) { extern volatile unsigned x, y, z; // UNSIGNED: uadd.with.overflow.i32 // UNSIGNED-NOT: llvm.trap diff --git a/clang/test/CodeGen/unwind-attr.c b/clang/test/CodeGen/unwind-attr.c index 5a7ec1b..50cbd6d 100644 --- a/clang/test/CodeGen/unwind-attr.c +++ b/clang/test/CodeGen/unwind-attr.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple i386-unknown-unknown -fexceptions -emit-llvm -o - %s | FileCheck %s // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck -check-prefix CHECK-NOEXC %s -int opaque(); +int opaque(void); // CHECK: define{{.*}} [[INT:i.*]] @test0() [[TF:#[0-9]+]] { // CHECK-NOEXC: define{{.*}} [[INT:i.*]] @test0() [[NUW:#[0-9]+]] { diff --git a/clang/test/CodeGen/utf16-cfstrings.c b/clang/test/CodeGen/utf16-cfstrings.c index dbe9bda..4ed1d07 100644 --- a/clang/test/CodeGen/utf16-cfstrings.c +++ b/clang/test/CodeGen/utf16-cfstrings.c @@ -5,6 +5,6 @@ #define CFSTR __builtin___CFStringMakeConstantString -void foo() { +void foo(void) { CFSTR("überhund"); } diff --git a/clang/test/CodeGen/uwtable-attr.c b/clang/test/CodeGen/uwtable-attr.c index e1b0c92..12ec158 100644 --- a/clang/test/CodeGen/uwtable-attr.c +++ b/clang/test/CodeGen/uwtable-attr.c @@ -17,7 +17,7 @@ struct S { ~S(); }; extern "C" int f() { S s; g(); return 0;}; #else void g(void); -int f() { g(); return 0; }; +int f(void) { g(); return 0; }; #endif // CHECK: define {{.*}} @f() #[[#F:]] diff --git a/clang/test/CodeGen/varargs.c b/clang/test/CodeGen/varargs.c index 3e2cce0..625399b 100644 --- a/clang/test/CodeGen/varargs.c +++ b/clang/test/CodeGen/varargs.c @@ -2,14 +2,14 @@ // PR6433 - Don't crash on va_arg(typedef). typedef double gdouble; -void focus_changed_cb () { +void focus_changed_cb (void) { __builtin_va_list pa; double mfloat; mfloat = __builtin_va_arg((pa), gdouble); } void vararg(int, ...); -void function_as_vararg() { +void function_as_vararg(void) { // CHECK: define {{.*}}function_as_vararg // CHECK-NOT: llvm.trap vararg(0, focus_changed_cb); diff --git a/clang/test/CodeGen/variable-array.c b/clang/test/CodeGen/variable-array.c index 80ca78d..d0787d3 100644 --- a/clang/test/CodeGen/variable-array.c +++ b/clang/test/CodeGen/variable-array.c @@ -8,12 +8,12 @@ int a(int x) } // PR3247 -int b() { +int b(void) { return sizeof(*(char(*)[puts("asdf")])0); } // PR3247 -int c() { +int c(void) { static int (*y)[puts("asdf")]; return sizeof(*y); } diff --git a/clang/test/CodeGen/ve-abi.c b/clang/test/CodeGen/ve-abi.c index 74248c1c..d9a415f 100644 --- a/clang/test/CodeGen/ve-abi.c +++ b/clang/test/CodeGen/ve-abi.c @@ -90,7 +90,7 @@ long double __complex__ fun_qcomplex(long double __complex__ a, long double __co } extern int hoge(); -void func() { +void func(void) { // CHECK: %call = call signext i32 (i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @hoge to i32 (i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 noundef signext 1, i32 noundef signext 2, i32 noundef signext 3, i32 noundef signext 4, i32 noundef signext 5, i32 noundef signext 6, i32 noundef signext 7) hoge(1, 2, 3, 4, 5, 6, 7); } diff --git a/clang/test/CodeGen/vecshift.c b/clang/test/CodeGen/vecshift.c index 9884975..bab0d6e 100644 --- a/clang/test/CodeGen/vecshift.c +++ b/clang/test/CodeGen/vecshift.c @@ -48,7 +48,7 @@ vector_uchar4 vuc4; vector_ushort4 vus4; vector_uint4 vui4; -void foo() { +void foo(void) { vc8 = 1 << vc8; // CHECK: [[t0:%.+]] = load <8 x i8>, <8 x i8>* {{@.+}}, // CHECK: shl <8 x i8> , [[t0]] diff --git a/clang/test/CodeGen/vector.c b/clang/test/CodeGen/vector.c index dfd75b6..9b9a356 100644 --- a/clang/test/CodeGen/vector.c +++ b/clang/test/CodeGen/vector.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -ffreestanding -triple i386-apple-darwin9 -O1 -target-cpu corei7 -debug-info-kind=limited -emit-llvm %s -o - | FileCheck %s typedef short __v4hi __attribute__ ((__vector_size__ (8))); -void test1() { +void test1(void) { __v4hi A = (__v4hi)0LL; } @@ -9,7 +9,7 @@ __v4hi x = {1,2,3}; __v4hi y = {1,2,3,4}; typedef int vty __attribute((vector_size(16))); -int test2() { vty b; return b[2LL]; } +int test2(void) { vty b; return b[2LL]; } // PR4339 typedef float vec4 __attribute__((vector_size(16))); @@ -54,7 +54,7 @@ unsigned long test_epi16(__m128i x) { return _mm_extract_epi16(x, 3); } // CHECK: extractelement <8 x i16> {{.*}}, {{i32|i64}} 3 // CHECK: zext i16 {{.*}} to i32 -void extractinttypes() { +void extractinttypes(void) { extern int check_extract_result_int; extern __typeof(_mm_extract_epi8(_mm_setzero_si128(), 3)) check_result_int; extern __typeof(_mm_extract_epi16(_mm_setzero_si128(), 3)) check_result_int; diff --git a/clang/test/CodeGen/vectorcall.c b/clang/test/CodeGen/vectorcall.c index a1f781f..9cbbbb1 100644 --- a/clang/test/CodeGen/vectorcall.c +++ b/clang/test/CodeGen/vectorcall.c @@ -85,7 +85,7 @@ struct HVA4 __vectorcall hva6(struct HVA4 a, struct HVA4 b) { return b;} // X32: define dso_local x86_vectorcallcc %struct.HVA4 @"\01hva6@@128"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* inreg noundef %b) // X64: define dso_local x86_vectorcallcc %struct.HVA4 @"\01hva6@@128"(%struct.HVA4 inreg %a.coerce, %struct.HVA4* noundef %b) -struct HVA5 __vectorcall hva7() {struct HVA5 a = {}; return a;} +struct HVA5 __vectorcall hva7(void) {struct HVA5 a = {}; return a;} // X32: define dso_local x86_vectorcallcc void @"\01hva7@@0"(%struct.HVA5* inreg noalias sret(%struct.HVA5) align 16 %agg.result) // X64: define dso_local x86_vectorcallcc void @"\01hva7@@0"(%struct.HVA5* noalias sret(%struct.HVA5) align 16 %agg.result) diff --git a/clang/test/CodeGen/vla-4.c b/clang/test/CodeGen/vla-4.c index 6e4ca98..a705213 100644 --- a/clang/test/CodeGen/vla-4.c +++ b/clang/test/CodeGen/vla-4.c @@ -1,24 +1,24 @@ // RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s -int f(); -int h(); +int f(void); +int h(void); -void t1() { +void t1(void) { _Atomic(typeof((int (*)[f()]) h())) v; // CHECK: [[N:%.*]] = alloca i32*, align 4 - // CHECK-NEXT: [[P:%.*]] = call i32 bitcast (i32 (...)* @f to i32 ()*)() - // CHECK-NEXT: [[P:%.*]] = call i32 bitcast (i32 (...)* @h to i32 ()*)() + // CHECK-NEXT: [[P:%.*]] = call i32 @f + // CHECK-NEXT: [[P:%.*]] = call i32 @h } -void t2() { +void t2(void) { typeof(typeof((int (*)[f()]) h())) v; // CHECK: [[N:%.*]] = alloca i32*, align 4 - // CHECK-NEXT: [[P:%.*]] = call i32 bitcast (i32 (...)* @f to i32 ()*)() - // CHECK-NEXT: [[P:%.*]] = call i32 bitcast (i32 (...)* @h to i32 ()*)() + // CHECK-NEXT: [[P:%.*]] = call i32 @f + // CHECK-NEXT: [[P:%.*]] = call i32 @h } void t3(typeof((int (*)[f()]) h()) v) { // CHECK: store i32* %v, i32** %{{[.0-9A-Za-z]+}}, align 4 - // CHECK-NEXT: [[P:%.*]] = call i32 bitcast (i32 (...)* @f to i32 ()*)() - // CHECK-NEXT: [[P:%.*]] = call i32 bitcast (i32 (...)* @h to i32 ()*)() + // CHECK-NEXT: [[P:%.*]] = call i32 @f + // CHECK-NEXT: [[P:%.*]] = call i32 @h } diff --git a/clang/test/CodeGen/vla.c b/clang/test/CodeGen/vla.c index 7ea9988..8138117 100644 --- a/clang/test/CodeGen/vla.c +++ b/clang/test/CodeGen/vla.c @@ -55,7 +55,7 @@ void f_8403108(unsigned x) { // pr7827 void function(short width, int data[][width]) {} // expected-note {{passing argument to parameter 'data' here}} -void test() { +void test(void) { int bork[4][13]; // CHECK: call void @function(i16 noundef signext 1, i32* noundef null) function(1, 0); @@ -66,7 +66,7 @@ void test() { } void function1(short width, int data[][width][width]) {} -void test1() { +void test1(void) { int bork[4][13][15]; // CHECK: call void @function1(i16 noundef signext 1, i32* noundef {{.*}}) function1(1, bork); @@ -213,7 +213,7 @@ void test10(int a[static 0]) {} const int constant = 32; // CHECK: define {{.*}}pr44406( -int pr44406() { +int pr44406(void) { int n = 0; // Do not fold this VLA to an array of constant bound; that would miscompile // this testcase. diff --git a/clang/test/CodeGen/vlt_to_pointer.c b/clang/test/CodeGen/vlt_to_pointer.c index d46d727..f06a160 100644 --- a/clang/test/CodeGen/vlt_to_pointer.c +++ b/clang/test/CodeGen/vlt_to_pointer.c @@ -17,7 +17,7 @@ int test(int n, int (*(*fn)(void))[n]) { } // CHECK-LABEL: @main -int main() +int main(void) { int m = 3; int (*d)[3*2] = c; diff --git a/clang/test/CodeGen/volatile-1.c b/clang/test/CodeGen/volatile-1.c index a0c7093..cb1beab 100644 --- a/clang/test/CodeGen/volatile-1.c +++ b/clang/test/CodeGen/volatile-1.c @@ -23,7 +23,7 @@ int printf(const char *, ...); // reduced. // CHECK-LABEL: define {{.*}}void @test() -void test() { +void test(void) { // CHECK: load volatile [[INT]], [[INT]]* @i i; // CHECK-NEXT: load volatile [[INT]], [[INT]]* getelementptr inbounds ([[CINT]], [[CINT]]* @ci, i32 0, i32 0), align 4 @@ -304,7 +304,7 @@ void test() { extern volatile enum X x; // CHECK-LABEL: define {{.*}}void @test1() -void test1() { +void test1(void) { extern void test1_helper(void); test1_helper(); // CHECK: call {{.*}}void @test1_helper() @@ -315,7 +315,7 @@ void test1() { } // CHECK: define {{.*}} @test2() -int test2() { +int test2(void) { // CHECK: load volatile i32, i32* // CHECK-NEXT: load volatile i32, i32* // CHECK-NEXT: load volatile i32, i32* diff --git a/clang/test/CodeGen/volatile-2.c b/clang/test/CodeGen/volatile-2.c index 4cd21af..ea76b5b 100644 --- a/clang/test/CodeGen/volatile-2.c +++ b/clang/test/CodeGen/volatile-2.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s -void test0() { +void test0(void) { // CHECK-LABEL: define{{.*}} void @test0() // CHECK: [[F:%.*]] = alloca float // CHECK-NEXT: [[REAL:%.*]] = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test0_v, i32 0, i32 0), align 4 @@ -11,7 +11,7 @@ void test0() { float f = (float) test0_v; } -void test1() { +void test1(void) { // CHECK-LABEL: define{{.*}} void @test1() // CHECK: [[REAL:%.*]] = load volatile float, float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4 // CHECK-NEXT: [[IMAG:%.*]] = load volatile float, float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4 diff --git a/clang/test/CodeGen/volatile-complex.c b/clang/test/CodeGen/volatile-complex.c index 4ecc3b1..4ebae54 100644 --- a/clang/test/CodeGen/volatile-complex.c +++ b/clang/test/CodeGen/volatile-complex.c @@ -13,7 +13,7 @@ volatile _Complex float cf32 __attribute__((aligned(32))); volatile _Complex double cd32 __attribute__((aligned(32))); // CHECK-LABEL: define{{.*}} void @test_cf() -void test_cf() { +void test_cf(void) { // CHECK: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 0), align 4 // CHECK-NEXT: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 1), align 4 (void)(cf); @@ -26,7 +26,7 @@ void test_cf() { } // CHECK-LABEL: define{{.*}} void @test_cd() -void test_cd() { +void test_cd(void) { // CHECK: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 0), align 8 // CHECK-NEXT: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 1), align 8 (void)(cd); @@ -39,7 +39,7 @@ void test_cd() { } // CHECK-LABEL: define{{.*}} void @test_cf32() -void test_cf32() { +void test_cf32(void) { // CHECK: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 0), align 32 // CHECK-NEXT: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 1), align 4 (void)(cf32); @@ -52,7 +52,7 @@ void test_cf32() { } // CHECK-LABEL: define{{.*}} void @test_cd32() -void test_cd32() { +void test_cd32(void) { // CHECK: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 0), align 32 // CHECK-NEXT: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 1), align 8 (void)(cd32); diff --git a/clang/test/CodeGen/volatile.c b/clang/test/CodeGen/volatile.c index 93772b8..d901673 100644 --- a/clang/test/CodeGen/volatile.c +++ b/clang/test/CodeGen/volatile.c @@ -37,7 +37,7 @@ volatile struct {int x;} aggFct(void); typedef volatile int volatile_int; volatile_int vtS; -int main() { +int main(void) { int i; // CHECK: [[I:%[a-zA-Z0-9_.]+]] = alloca i32 // load diff --git a/clang/test/CodeGen/whilestmt.c b/clang/test/CodeGen/whilestmt.c index 3973b28..3910406 100644 --- a/clang/test/CodeGen/whilestmt.c +++ b/clang/test/CodeGen/whilestmt.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -int bar(); -int foo() { +int bar(void); +int foo(void) { int i; i = 1 + 2; while(1) { @@ -12,7 +12,7 @@ int foo() { } -int foo1() { +int foo1(void) { int i; i = 1 + 2; while(1) { @@ -25,7 +25,7 @@ int foo1() { } -int foo2() { +int foo2(void) { int i; i = 1 + 2; while(1) { @@ -38,7 +38,7 @@ int foo2() { } -int foo3() { +int foo3(void) { int i; i = 1 + 2; while(1) { @@ -50,7 +50,7 @@ int foo3() { } -int foo4() { +int foo4(void) { int i; i = 1 + 2; while(1) { diff --git a/clang/test/CodeGen/win64-i128.c b/clang/test/CodeGen/win64-i128.c index 0adf617..32595cb 100644 --- a/clang/test/CodeGen/win64-i128.c +++ b/clang/test/CodeGen/win64-i128.c @@ -5,7 +5,7 @@ typedef int int128_t __attribute__((mode(TI))); -int128_t foo() { return 0; } +int128_t foo(void) { return 0; } // GNU64: define dso_local <2 x i64> @foo() // MSC64: define dso_local <2 x i64> @foo() diff --git a/clang/test/CodeGen/windows-itanium.c b/clang/test/CodeGen/windows-itanium.c index 09613e1..ad2e8a7 100644 --- a/clang/test/CodeGen/windows-itanium.c +++ b/clang/test/CodeGen/windows-itanium.c @@ -4,7 +4,7 @@ // RUN: %clang_cc1 -triple i686-windows-itanium -emit-llvm -x c++ %s -o - \ // RUN: | FileCheck %s -check-prefix CHECK-CXX -check-prefix CHECK -int function() { +int function(void) { return 32; } diff --git a/clang/test/CodeGen/windows-on-arm-dllimport-dllexport.c b/clang/test/CodeGen/windows-on-arm-dllimport-dllexport.c index 47f7f99..bec5b2f 100644 --- a/clang/test/CodeGen/windows-on-arm-dllimport-dllexport.c +++ b/clang/test/CodeGen/windows-on-arm-dllimport-dllexport.c @@ -4,14 +4,14 @@ __declspec(dllexport) int export_int; __declspec(dllimport) int import_int; -__declspec(dllexport) void export_declared_function(); +__declspec(dllexport) void export_declared_function(void); -__declspec(dllexport) void export_implemented_function() { +__declspec(dllexport) void export_implemented_function(void) { } __declspec(dllimport) void import_function(int); -void call_imported_function() { +void call_imported_function(void) { export_declared_function(); return import_function(import_int); } diff --git a/clang/test/CodeGen/windows-swiftcall.c b/clang/test/CodeGen/windows-swiftcall.c index ce56367..265650b 100644 --- a/clang/test/CodeGen/windows-swiftcall.c +++ b/clang/test/CodeGen/windows-swiftcall.c @@ -35,7 +35,7 @@ SWIFTCALL void context_error_1(CONTEXT int *self, ERROR float **error) {} // CHECK: store float* [[T0]], float** [[TEMP]], align 8 // CHECK: [[T0:%.*]] = load float*, float** [[TEMP]], align 8 // CHECK: store float* [[T0]], float** [[ERRORARG]], align 8 -void test_context_error_1() { +void test_context_error_1(void) { int x; float *error; context_error_1(&x, &error); @@ -73,7 +73,7 @@ typedef int int8 __attribute__((ext_vector_type(8))); } \ SWIFTCALL void take_##TYPE(TYPE v) { \ } \ - void test_##TYPE() { \ + void test_##TYPE(void) { \ take_##TYPE(return_##TYPE()); \ } diff --git a/clang/test/CodeGen/writable-strings.c b/clang/test/CodeGen/writable-strings.c index 693fa5e..92d971f 100644 --- a/clang/test/CodeGen/writable-strings.c +++ b/clang/test/CodeGen/writable-strings.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -emit-llvm -o - -fwritable-strings %s -int main() { +int main(void) { char *str = "abc"; str[0] = '1'; printf("%s", str); diff --git a/clang/test/CodeGen/zero-call-used-regs.c b/clang/test/CodeGen/zero-call-used-regs.c index 35ce5e2..4437751 100644 --- a/clang/test/CodeGen/zero-call-used-regs.c +++ b/clang/test/CodeGen/zero-call-used-regs.c @@ -218,32 +218,32 @@ #define __zero_call_used_regs(kind) __attribute__((zero_call_used_regs(kind))) -void no_attribute() { +void no_attribute(void) { } -void __zero_call_used_regs("skip") skip_test() { +void __zero_call_used_regs("skip") skip_test(void) { } -void __zero_call_used_regs("used-gpr-arg") used_gpr_arg_test() { +void __zero_call_used_regs("used-gpr-arg") used_gpr_arg_test(void) { } -void __zero_call_used_regs("used-gpr") used_gpr_test() { +void __zero_call_used_regs("used-gpr") used_gpr_test(void) { } -void __zero_call_used_regs("used-arg") used_arg_test() { +void __zero_call_used_regs("used-arg") used_arg_test(void) { } -void __zero_call_used_regs("used") used_test() { +void __zero_call_used_regs("used") used_test(void) { } -void __zero_call_used_regs("all-gpr-arg") all_gpr_arg_test() { +void __zero_call_used_regs("all-gpr-arg") all_gpr_arg_test(void) { } -void __zero_call_used_regs("all-gpr") all_gpr_test() { +void __zero_call_used_regs("all-gpr") all_gpr_test(void) { } -void __zero_call_used_regs("all-arg") all_arg_test() { +void __zero_call_used_regs("all-arg") all_arg_test(void) { } -void __zero_call_used_regs("all") all_test() { +void __zero_call_used_regs("all") all_test(void) { } diff --git a/clang/test/CodeGenObjC/2008-11-25-Blocks.m b/clang/test/CodeGenObjC/2008-11-25-Blocks.m index 39364d5..80f45b5 100644 --- a/clang/test/CodeGenObjC/2008-11-25-Blocks.m +++ b/clang/test/CodeGenObjC/2008-11-25-Blocks.m @@ -2,16 +2,16 @@ // rdar://6394879 @interface bork -- (id)B:(void (^)())blk; +- (id)B:(void (^)(void))blk; - (void)C; @end @implementation bork -- (id)B:(void (^)())blk { +- (id)B:(void (^)(void))blk { __attribute__((__blocks__(byref))) bork* new = ((void *)0); blk(); } - (void)C { __attribute__((__blocks__(byref))) id var; - [self B:^() {}]; + [self B:^(void) {}]; } @end diff --git a/clang/test/CodeGenObjC/2009-02-05-VolatileProp.m b/clang/test/CodeGenObjC/2009-02-05-VolatileProp.m index 1f696ac..01aecfd 100644 --- a/clang/test/CodeGenObjC/2009-02-05-VolatileProp.m +++ b/clang/test/CodeGenObjC/2009-02-05-VolatileProp.m @@ -2,7 +2,7 @@ // rdar://6551276 void foo(const unsigned short *); -void bar() { +void bar(void) { unsigned short *s[3]; int i; @try { } @catch (id anException) { } diff --git a/clang/test/CodeGenObjC/arc-blocks-exceptions.m b/clang/test/CodeGenObjC/arc-blocks-exceptions.m index ae67d5a..b54061a 100644 --- a/clang/test/CodeGenObjC/arc-blocks-exceptions.m +++ b/clang/test/CodeGenObjC/arc-blocks-exceptions.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -fexceptions -disable-llvm-passes -o - %s | FileCheck %s void test1(_Bool c) { - void test1_fn(void (^blk)()); + void test1_fn(void (^blk)(void)); __weak id weakId = 0; test1_fn(c ? ^{ (void)weakId; } : 0); diff --git a/clang/test/CodeGenObjC/arc-blocks.m b/clang/test/CodeGenObjC/arc-blocks.m index fb492e1..81ea33a 100644 --- a/clang/test/CodeGenObjC/arc-blocks.m +++ b/clang/test/CodeGenObjC/arc-blocks.m @@ -555,7 +555,7 @@ void test13(id x) { } // -void test14() { +void test14(void) { void (^const x[1])(void) = { ^{} }; } @@ -567,7 +567,7 @@ void test15(int a) { } // rdar://11016025 -void test16() { +void test16(void) { void (^BLKVAR)(void) = ^{ BLKVAR(); }; // CHECK-LABEL: define{{.*}} void @test16( diff --git a/clang/test/CodeGenObjC/arc-bridged-cast.m b/clang/test/CodeGenObjC/arc-bridged-cast.m index da8f0e5..2d44dd1 100644 --- a/clang/test/CodeGenObjC/arc-bridged-cast.m +++ b/clang/test/CodeGenObjC/arc-bridged-cast.m @@ -95,7 +95,7 @@ void bridge_of_cf(int *i) { } // CHECK-LABEL: define{{.*}} %struct.__CFString* @bridge_of_paren_expr() -CFStringRef bridge_of_paren_expr() { +CFStringRef bridge_of_paren_expr(void) { // CHECK-NOT: "@llvm.objc" CFStringRef r = (__bridge CFStringRef)(CreateNSString()); r = (__bridge CFStringRef)((NSString *)(CreateNSString())); diff --git a/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m b/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m index e944e35..1375fe9 100644 --- a/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m +++ b/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout-2.m @@ -7,36 +7,36 @@ extern void NSLog(NSString *format, ...); extern int printf(const char *, ...); -int main() { +int main(void) { NSString *strong; unsigned long long eightByte = 0x8001800181818181ull; // Test1 // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0 - void (^block1)() = ^{ printf("%#llx", eightByte); NSLog(@"%@", strong); }; + void (^block1)(void) = ^{ printf("%#llx", eightByte); NSLog(@"%@", strong); }; // Test2 int i = 1; // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0 - void (^block2)() = ^{ printf("%#llx, %d", eightByte, i); NSLog(@"%@", strong); }; + void (^block2)(void) = ^{ printf("%#llx, %d", eightByte, i); NSLog(@"%@", strong); }; // Test3 char ch = 'a'; // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0 - void (^block3)() = ^{ printf("%c %#llx", ch, eightByte); NSLog(@"%@", strong); }; + void (^block3)(void) = ^{ printf("%c %#llx", ch, eightByte); NSLog(@"%@", strong); }; // Test4 unsigned long fourByte = 0x8001ul; // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0 - void (^block4)() = ^{ printf("%c %#lx", ch, fourByte); NSLog(@"%@", strong); }; + void (^block4)(void) = ^{ printf("%c %#lx", ch, fourByte); NSLog(@"%@", strong); }; // Test5 // Nothing gets printed here since the descriptor of this block is merged with // the descriptor of Test3's block. - void (^block5)() = ^{ NSLog(@"%@", strong); printf("%c %#llx", ch, eightByte); }; + void (^block5)(void) = ^{ NSLog(@"%@", strong); printf("%c %#llx", ch, eightByte); }; // Test6 // CHECK: Block variable layout: BL_OPERATOR:0 - void (^block6)() = ^{ printf("%#llx", eightByte); }; + void (^block6)(void) = ^{ printf("%#llx", eightByte); }; } /** diff --git a/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m b/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m index d1b5783..838346c 100644 --- a/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m +++ b/clang/test/CodeGenObjC/arc-captured-32bit-block-var-layout.m @@ -6,9 +6,9 @@ void x(id y) {} void y(int a) {} -extern id opaque_id(); +extern id opaque_id(void); -void f() { +void f(void) { __weak id wid; __block int byref_int = 0; char ch = 'a'; @@ -34,7 +34,7 @@ void f() { // Test 1 // CHECK: Inline block variable layout: 0x0320, BL_STRONG:3, BL_BYREF:2, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ byref_int = sh + ch+ch1+ch2 ; x(bar); x(baz); @@ -45,7 +45,7 @@ void f() { // Test 2 // CHECK: Inline block variable layout: 0x0331, BL_STRONG:3, BL_BYREF:3, BL_WEAK:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ byref_int = sh + ch+ch1+ch2 ; x(bar); x(baz); @@ -57,7 +57,7 @@ void f() { } @class NSString, NSNumber; -void g() { +void g(void) { NSString *foo; NSNumber *bar; unsigned int bletch; @@ -66,7 +66,7 @@ void g() { NSString *y; NSString *z; // CHECK: Inline block variable layout: 0x0401, BL_STRONG:4, BL_WEAK:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ int j = i + bletch; x(foo); x(bar); @@ -78,7 +78,7 @@ void g() { } // Test 5 (unions/structs and their nesting): -void h() { +void h(void) { struct S5 { int i1; __unsafe_unretained id o1; @@ -111,7 +111,7 @@ block variable layout: BL_NON_OBJECT_WORD:1, BL_UNRETAINE:1, BL_NON_OBJECT_WORD: BL_UNRETAINE:1, BL_NON_OBJECT_WORD:3, BL_BYREF:1, BL_OPERATOR:0 */ // CHECK: Block variable layout: BL_BYREF:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(s2.ui.o1); x(u2.o1); block_id = 0; @@ -120,13 +120,13 @@ block variable layout: BL_NON_OBJECT_WORD:1, BL_UNRETAINE:1, BL_NON_OBJECT_WORD: } // Test for array of stuff. -void arr1() { +void arr1(void) { struct S { __unsafe_unretained id unsafe_unretained_var[4]; } imported_s; // CHECK: Block variable layout: BL_UNRETAINED:4, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(imported_s.unsafe_unretained_var[2]); }; @@ -134,14 +134,14 @@ void arr1() { } // Test2 for array of stuff. -void arr2() { +void arr2(void) { struct S { int a; __unsafe_unretained id unsafe_unretained_var[4]; } imported_s; // CHECK: Block variable layout: BL_NON_OBJECT_WORD:1, BL_UNRETAINED:4, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(imported_s.unsafe_unretained_var[2]); }; @@ -149,14 +149,14 @@ void arr2() { } // Test3 for array of stuff. -void arr3() { +void arr3(void) { struct S { int a; __unsafe_unretained id unsafe_unretained_var[0]; } imported_s; // CHECK: Block variable layout: BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ int i = imported_s.a; }; @@ -166,7 +166,7 @@ void arr3() { // Test4 for array of stuff. @class B; -void arr4() { +void arr4(void) { struct S { struct s0 { __unsafe_unretained id s_f0; @@ -182,7 +182,7 @@ void arr4() { } captured_s; // CHECK: Block variable layout: BL_UNRETAINED:3, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ id i = captured_s.f0.s_f1; }; @@ -190,7 +190,7 @@ void arr4() { } // Test1 bitfield in cpatured aggregate. -void bf1() { +void bf1(void) { struct S { int flag : 25; int flag1: 7; @@ -200,27 +200,27 @@ void bf1() { } s; // CHECK: Block variable layout: BL_OPERATOR:0 - int (^c)() = ^{ + int (^c)(void) = ^{ return s.flag; }; c(); } // Test2 bitfield in cpatured aggregate. -void bf2() { +void bf2(void) { struct S { int flag : 1; } s; // CHECK: Block variable layout: BL_OPERATOR:0 - int (^c)() = ^{ + int (^c)(void) = ^{ return s.flag; }; c(); } // Test3 bitfield in cpatured aggregate. -void bf3() { +void bf3(void) { struct { unsigned short _reserved : 16; @@ -244,7 +244,7 @@ void bf3() { } _flags; // CHECK: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags._draggedNodesAreDeletable; }; @@ -252,7 +252,7 @@ void bf3() { } // Test4 unnamed bitfield -void bf4() { +void bf4(void) { struct { unsigned short _reserved : 16; @@ -279,7 +279,7 @@ void bf4() { } _flags; // CHECK: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags._draggedNodesAreDeletable; }; @@ -289,7 +289,7 @@ void bf4() { // Test5 unnamed bitfield. -void bf5() { +void bf5(void) { struct { unsigned char flag : 1; unsigned int : 32; @@ -297,7 +297,7 @@ void bf5() { } _flags; // CHECK: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags.flag; }; @@ -306,7 +306,7 @@ void bf5() { // Test6 0 length bitfield. -void bf6() { +void bf6(void) { struct { unsigned char flag : 1; unsigned int : 0; @@ -314,7 +314,7 @@ void bf6() { } _flags; // CHECK: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags.flag; }; @@ -322,7 +322,7 @@ void bf6() { } // Test7 large number of captured variables. -void Test7() { +void Test7(void) { __weak id wid; __weak id wid1, wid2, wid3, wid4; __weak id wid5, wid6, wid7, wid8; @@ -330,7 +330,7 @@ void Test7() { __weak id wid13, wid14, wid15, wid16; const id bar = (id) opaque_id(); // CHECK: Block variable layout: BL_STRONG:1, BL_WEAK:16, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ x(bar); x(wid1); x(wid2); @@ -353,7 +353,7 @@ void Test7() { // Test 8 very large number of captured variables. -void Test8() { +void Test8(void) { __weak id wid; __weak id wid1, wid2, wid3, wid4; __weak id wid5, wid6, wid7, wid8; @@ -365,7 +365,7 @@ __weak id wid; __weak id w13, w14, w15, w16; const id bar = (id) opaque_id(); // CHECK: Block variable layout: BL_STRONG:1, BL_WEAK:16, BL_WEAK:16, BL_WEAK:1, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ x(bar); x(wid1); x(wid2); diff --git a/clang/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m b/clang/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m index 022b096..24e1bea 100644 --- a/clang/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m +++ b/clang/test/CodeGenObjC/arc-captured-block-var-inlined-layout.m @@ -7,9 +7,9 @@ void x(id y) {} void y(int a) {} -extern id opaque_id(); +extern id opaque_id(void); -void f() { +void f(void) { __block int byref_int = 0; const id bar = (id) opaque_id(); id baz = 0; @@ -18,19 +18,19 @@ void f() { __block id bl_var1; // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ x(bar); }; // CHECK: Inline block variable layout: 0x0210, BL_STRONG:2, BL_BYREF:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(bar); x(baz); byref_int = 1; }; // CHECK: Inline block variable layout: 0x0230, BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0 - void (^d)() = ^{ + void (^d)(void) = ^{ x(bar); x(baz); byref_int = 1; @@ -40,7 +40,7 @@ void f() { // CHECK: Inline block variable layout: 0x0231, BL_STRONG:2, BL_BYREF:3, BL_WEAK:1, BL_OPERATOR:0 __weak id wid; - id (^e)() = ^{ + id (^e)(void) = ^{ x(bar); x(baz); byref_int = 1; @@ -51,7 +51,7 @@ void f() { // CHECK: Inline block variable layout: 0x0235, BL_STRONG:2, BL_BYREF:3, BL_WEAK:5, BL_OPERATOR:0 __weak id wid1, wid2, wid3, wid4; - id (^f)() = ^{ + id (^f)(void) = ^{ x(bar); x(baz); byref_int = 1; @@ -65,7 +65,7 @@ void f() { }; // CHECK: Inline block variable layout: 0x035, BL_BYREF:3, BL_WEAK:5, BL_OPERATOR:0 - id (^g)() = ^{ + id (^g)(void) = ^{ byref_int = 1; bl_var1 = 0; byref_bab = 0; @@ -77,18 +77,18 @@ void f() { }; // CHECK: Inline block variable layout: 0x01, BL_WEAK:1, BL_OPERATOR:0 - id (^h)() = ^{ + id (^h)(void) = ^{ return wid; }; // CHECK: Inline block variable layout: 0x020, BL_BYREF:2, BL_OPERATOR:0 - void (^ii)() = ^{ + void (^ii)(void) = ^{ byref_int = 1; byref_bab = 0; }; // CHECK: Inline block variable layout: 0x0102, BL_STRONG:1, BL_WEAK:2, BL_OPERATOR:0 - void (^jj)() = ^{ + void (^jj)(void) = ^{ x(bar); x(wid1); x(wid2); @@ -99,7 +99,7 @@ void f() { @class NSString; extern void NSLog(NSString *format, ...); typedef void (^dispatch_block_t)(void); -int main() { +int main(void) { __strong NSString *s1 = 0; __strong NSString *s2 = 0; __weak NSString *w1 = 0; diff --git a/clang/test/CodeGenObjC/arc-captured-block-var-layout.m b/clang/test/CodeGenObjC/arc-captured-block-var-layout.m index f8518d1..57135171 100644 --- a/clang/test/CodeGenObjC/arc-captured-block-var-layout.m +++ b/clang/test/CodeGenObjC/arc-captured-block-var-layout.m @@ -6,9 +6,9 @@ void x(id y) {} void y(int a) {} -extern id opaque_id(); +extern id opaque_id(void); -void f() { +void f(void) { __weak id wid; __block int byref_int = 0; char ch = 'a'; @@ -35,7 +35,7 @@ void f() { // Test 1 // Inline instruction for block variable layout: 0x0320 (3 strong 2 byref) // CHECK-LP64: Inline block variable layout: 0x0320, BL_STRONG:3, BL_BYREF:2, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ byref_int = sh + ch+ch1+ch2 ; x(bar); x(baz); @@ -47,7 +47,7 @@ void f() { // Test 2 // Inline instruction for block variable layout: 0x0331 (3 strong 3 byref 1 weak) // CHECK-LP64: Inline block variable layout: 0x0331, BL_STRONG:3, BL_BYREF:3, BL_WEAK:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ byref_int = sh + ch+ch1+ch2 ; x(bar); x(baz); @@ -59,7 +59,7 @@ void f() { } @class NSString, NSNumber; -void g() { +void g(void) { NSString *foo; NSNumber *bar; unsigned int bletch; @@ -69,7 +69,7 @@ void g() { NSString *z; // Inline instruction for block variable layout: 0x0401 (4 strong 0 byref 1 weak) // CHECK-LP64: Inline block variable layout: 0x0401, BL_STRONG:4, BL_WEAK:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ int j = i + bletch; x(foo); x(bar); @@ -81,7 +81,7 @@ void g() { } // Test 5 (unions/structs and their nesting): -void h() { +void h(void) { struct S5 { int i1; __unsafe_unretained id o1; @@ -110,7 +110,7 @@ void h() { __block id block_id; // CHECK-LP64: Block variable layout: BL_BYREF:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(s2.ui.o1); x(u2.o1); block_id = 0; @@ -119,13 +119,13 @@ void h() { } // Test for array of stuff. -void arr1() { +void arr1(void) { struct S { __unsafe_unretained id unsafe_unretained_var[4]; } imported_s; // CHECK-LP64: Block variable layout: BL_UNRETAINED:4, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(imported_s.unsafe_unretained_var[2]); }; @@ -133,14 +133,14 @@ void arr1() { } // Test2 for array of stuff. -void arr2() { +void arr2(void) { struct S { int a; __unsafe_unretained id unsafe_unretained_var[4]; } imported_s; // CHECK-LP64: Block variable layout: BL_NON_OBJECT_WORD:1, BL_UNRETAINED:4, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(imported_s.unsafe_unretained_var[2]); }; @@ -148,14 +148,14 @@ void arr2() { } // Test3 for array of stuff. -void arr3() { +void arr3(void) { struct S { int a; __unsafe_unretained id unsafe_unretained_var[0]; } imported_s; // CHECK-LP64: Block variable layout: BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ int i = imported_s.a; }; @@ -165,7 +165,7 @@ void arr3() { // Test4 for array of stuff. @class B; -void arr4() { +void arr4(void) { struct S { struct s0 { __unsafe_unretained id s_f0; @@ -181,7 +181,7 @@ void arr4() { } captured_s; // CHECK-LP64: Block variable layout: BL_UNRETAINED:3, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_NON_OBJECT_WORD:1, BL_UNRETAINED:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ id i = captured_s.f0.s_f1; }; @@ -189,7 +189,7 @@ void arr4() { } // Test1 bitfield in cpatured aggregate. -void bf1() { +void bf1(void) { struct S { int flag : 25; int flag1: 7; @@ -199,27 +199,27 @@ void bf1() { } s; // CHECK-LP64: Block variable layout: BL_OPERATOR:0 - int (^c)() = ^{ + int (^c)(void) = ^{ return s.flag; }; c(); } // Test2 bitfield in cpatured aggregate. -void bf2() { +void bf2(void) { struct S { int flag : 1; } s; // CHECK-LP64: Block variable layout: BL_OPERATOR:0 - int (^c)() = ^{ + int (^c)(void) = ^{ return s.flag; }; c(); } // Test3 bitfield in cpatured aggregate. -void bf3() { +void bf3(void) { struct { unsigned short _reserved : 16; @@ -243,7 +243,7 @@ void bf3() { } _flags; // CHECK-LP64: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags._draggedNodesAreDeletable; }; @@ -251,7 +251,7 @@ void bf3() { } // Test4 unnamed bitfield -void bf4() { +void bf4(void) { struct { unsigned short _reserved : 16; @@ -278,7 +278,7 @@ void bf4() { } _flags; // CHECK-LP64: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags._draggedNodesAreDeletable; }; @@ -288,7 +288,7 @@ void bf4() { // Test5 unnamed bitfield. -void bf5() { +void bf5(void) { struct { unsigned char flag : 1; unsigned int : 32; @@ -296,7 +296,7 @@ void bf5() { } _flags; // CHECK-LP64: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags.flag; }; @@ -305,7 +305,7 @@ void bf5() { // Test6 0 length bitfield. -void bf6() { +void bf6(void) { struct { unsigned char flag : 1; unsigned int : 0; @@ -313,7 +313,7 @@ void bf6() { } _flags; // CHECK-LP64: Block variable layout: BL_OPERATOR:0 - unsigned char (^c)() = ^{ + unsigned char (^c)(void) = ^{ return _flags.flag; }; @@ -321,7 +321,7 @@ void bf6() { } // Test7 large number of captured variables. -void Test7() { +void Test7(void) { __weak id wid; __weak id wid1, wid2, wid3, wid4; __weak id wid5, wid6, wid7, wid8; @@ -329,7 +329,7 @@ void Test7() { __weak id wid13, wid14, wid15, wid16; const id bar = (id) opaque_id(); // CHECK-LP64: Block variable layout: BL_STRONG:1, BL_WEAK:16, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ x(bar); x(wid1); x(wid2); @@ -352,7 +352,7 @@ void Test7() { // Test 8 very large number of captured variables. -void Test8() { +void Test8(void) { __weak id wid; __weak id wid1, wid2, wid3, wid4; __weak id wid5, wid6, wid7, wid8; @@ -364,7 +364,7 @@ __weak id wid; __weak id w13, w14, w15, w16; const id bar = (id) opaque_id(); // CHECK-LP64: Block variable layout: BL_STRONG:1, BL_WEAK:16, BL_WEAK:16, BL_WEAK:1, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ x(bar); x(wid1); x(wid2); diff --git a/clang/test/CodeGenObjC/arc-literals.m b/clang/test/CodeGenObjC/arc-literals.m index 257c330..e7c03d5 100644 --- a/clang/test/CodeGenObjC/arc-literals.m +++ b/clang/test/CodeGenObjC/arc-literals.m @@ -13,7 +13,7 @@ // CHECK: c"prop\00" // CHECK-LABEL: define{{.*}} void @test_numeric() -void test_numeric() { +void test_numeric(void) { // CHECK: {{call.*objc_msgSend.*i32 17.* [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]}} id ilit = @17; // CHECK: {{call.*objc_msgSend.*i32 25.* [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]}} diff --git a/clang/test/CodeGenObjC/arc-no-runtime.m b/clang/test/CodeGenObjC/arc-no-runtime.m index 31f0ed8..408c4f2 100644 --- a/clang/test/CodeGenObjC/arc-no-runtime.m +++ b/clang/test/CodeGenObjC/arc-no-runtime.m @@ -2,7 +2,7 @@ // rdar://problem/9224855 id make(void) __attribute__((ns_returns_retained)); -void test0() { +void test0(void) { make(); id x = 0; // CHECK: call void @llvm.objc.release( diff --git a/clang/test/CodeGenObjC/arc-precise-lifetime.m b/clang/test/CodeGenObjC/arc-precise-lifetime.m index 5d0efb0..f81c44b 100644 --- a/clang/test/CodeGenObjC/arc-precise-lifetime.m +++ b/clang/test/CodeGenObjC/arc-precise-lifetime.m @@ -3,7 +3,7 @@ #define PRECISE_LIFETIME __attribute__((objc_precise_lifetime)) id test0_helper(void) __attribute__((ns_returns_retained)); -void test0() { +void test0(void) { PRECISE_LIFETIME id x = test0_helper(); x = 0; // CHECK: [[X:%.*]] = alloca i8* diff --git a/clang/test/CodeGenObjC/arc-rv-attr.m b/clang/test/CodeGenObjC/arc-rv-attr.m index 7dc535c..2af360e 100644 --- a/clang/test/CodeGenObjC/arc-rv-attr.m +++ b/clang/test/CodeGenObjC/arc-rv-attr.m @@ -5,7 +5,7 @@ A *makeA(void); -void test_assign() { +void test_assign(void) { __unsafe_unretained id x; x = makeA(); } @@ -19,7 +19,7 @@ void test_assign() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_assign_assign() { +void test_assign_assign(void) { __unsafe_unretained id x, y; x = y = makeA(); } @@ -37,7 +37,7 @@ void test_assign_assign() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_strong_assign_assign() { +void test_strong_assign_assign(void) { __strong id x; __unsafe_unretained id y; x = y = makeA(); @@ -60,7 +60,7 @@ void test_strong_assign_assign() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_assign_strong_assign() { +void test_assign_strong_assign(void) { __unsafe_unretained id x; __strong id y; x = y = makeA(); @@ -83,7 +83,7 @@ void test_assign_strong_assign() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_init() { +void test_init(void) { __unsafe_unretained id x = makeA(); } // CHECK-LABEL: define{{.*}} void @test_init() @@ -96,7 +96,7 @@ void test_init() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_init_assignment() { +void test_init_assignment(void) { __unsafe_unretained id x; __unsafe_unretained id y = x = makeA(); } @@ -114,7 +114,7 @@ void test_init_assignment() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_strong_init_assignment() { +void test_strong_init_assignment(void) { __unsafe_unretained id x; __strong id y = x = makeA(); } @@ -134,7 +134,7 @@ void test_strong_init_assignment() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_init_strong_assignment() { +void test_init_strong_assignment(void) { __strong id x; __unsafe_unretained id y = x = makeA(); } @@ -156,7 +156,7 @@ void test_init_strong_assignment() { // CHECK-NEXT: lifetime.end // CHECK-NEXT: ret void -void test_ignored() { +void test_ignored(void) { makeA(); } // CHECK-LABEL: define{{.*}} void @test_ignored() @@ -164,7 +164,7 @@ void test_ignored() { // CHECK-NEXT: call void (...) @llvm.objc.clang.arc.noop.use({{.*}} [[T0]]) // CHECK-NEXT: ret void -void test_cast_to_void() { +void test_cast_to_void(void) { (void) makeA(); } // CHECK-LABEL: define{{.*}} void @test_cast_to_void() diff --git a/clang/test/CodeGenObjC/arc-unbridged-cast.m b/clang/test/CodeGenObjC/arc-unbridged-cast.m index 72b7b01..f0f32b4 100644 --- a/clang/test/CodeGenObjC/arc-unbridged-cast.m +++ b/clang/test/CodeGenObjC/arc-unbridged-cast.m @@ -25,8 +25,8 @@ typedef const struct __CFString * CFStringRef; @end // rdar://9544832 -CFStringRef SomeOtherFunc() __attribute__((cf_returns_retained)); -id MMM() +CFStringRef SomeOtherFunc(void) __attribute__((cf_returns_retained)); +id MMM(void) { id obj = (id)((CFStringRef) __builtin___CFStringMakeConstantString ("" "Some CF String" "")); return 0; diff --git a/clang/test/CodeGenObjC/arc-unoptimized-byref-var.m b/clang/test/CodeGenObjC/arc-unoptimized-byref-var.m index bd57335..c794e37 100644 --- a/clang/test/CodeGenObjC/arc-unoptimized-byref-var.m +++ b/clang/test/CodeGenObjC/arc-unoptimized-byref-var.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fblocks -fobjc-arc -fobjc-runtime-has-weak -o - %s | FileCheck -check-prefix=CHECK-UNOPT %s // rdar://12530881 -void test19() { +void test19(void) { __block id x; ^{ (void)x; }; // CHECK-UNOPT-LABEL: define internal void @__Block_byref_object_copy diff --git a/clang/test/CodeGenObjC/arc-unsafeclaim.m b/clang/test/CodeGenObjC/arc-unsafeclaim.m index ca82bbe..dc353a5 100644 --- a/clang/test/CodeGenObjC/arc-unsafeclaim.m +++ b/clang/test/CodeGenObjC/arc-unsafeclaim.m @@ -21,7 +21,7 @@ A *makeA(void); -void test_assign() { +void test_assign(void) { __unsafe_unretained id x; x = makeA(); } @@ -49,7 +49,7 @@ void test_assign() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_assign_assign() { +void test_assign_assign(void) { __unsafe_unretained id x, y; x = y = makeA(); } @@ -75,7 +75,7 @@ void test_assign_assign() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_strong_assign_assign() { +void test_strong_assign_assign(void) { __strong id x; __unsafe_unretained id y; x = y = makeA(); @@ -106,7 +106,7 @@ void test_strong_assign_assign() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_assign_strong_assign() { +void test_assign_strong_assign(void) { __unsafe_unretained id x; __strong id y; x = y = makeA(); @@ -137,7 +137,7 @@ void test_assign_strong_assign() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_init() { +void test_init(void) { __unsafe_unretained id x = makeA(); } // CHECK-LABEL: define{{.*}} void @test_init() @@ -158,7 +158,7 @@ void test_init() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_init_assignment() { +void test_init_assignment(void) { __unsafe_unretained id x; __unsafe_unretained id y = x = makeA(); } @@ -184,7 +184,7 @@ void test_init_assignment() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_strong_init_assignment() { +void test_strong_init_assignment(void) { __unsafe_unretained id x; __strong id y = x = makeA(); } @@ -212,7 +212,7 @@ void test_strong_init_assignment() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_init_strong_assignment() { +void test_init_strong_assignment(void) { __strong id x; __unsafe_unretained id y = x = makeA(); } @@ -242,7 +242,7 @@ void test_init_strong_assignment() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_ignored() { +void test_ignored(void) { makeA(); } // CHECK-LABEL: define{{.*}} void @test_ignored() @@ -258,7 +258,7 @@ void test_ignored() { // ATTACHED-CALL: [[T0:%.*]] = call [[A:.*]]* @makeA() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ], // ATTACHED-CALL: call void (...) @llvm.objc.clang.arc.noop.use([[A]]* [[T0]]) -void test_cast_to_void() { +void test_cast_to_void(void) { (void) makeA(); } // CHECK-LABEL: define{{.*}} void @test_cast_to_void() diff --git a/clang/test/CodeGenObjC/arc-with-atthrow.m b/clang/test/CodeGenObjC/arc-with-atthrow.m index 86ed401..f61d72a 100644 --- a/clang/test/CodeGenObjC/arc-with-atthrow.m +++ b/clang/test/CodeGenObjC/arc-with-atthrow.m @@ -3,7 +3,7 @@ // rdar://10042689 id make(void); -void test() { +void test(void) { @throw make(); } diff --git a/clang/test/CodeGenObjC/arc.m b/clang/test/CodeGenObjC/arc.m index 150f87b..60ef515 100644 --- a/clang/test/CodeGenObjC/arc.m +++ b/clang/test/CodeGenObjC/arc.m @@ -97,7 +97,7 @@ id test1(id x) { @end // CHECK-LABEL: define{{.*}} void @test3_unelided() -void test3_unelided() { +void test3_unelided(void) { extern void test3_helper(void); // CHECK: [[X:%.*]] = alloca [[TEST3:%.*]]* @@ -132,7 +132,7 @@ void test3_unelided() { } // CHECK-LABEL: define{{.*}} void @test3() -void test3() { +void test3(void) { // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* [[XPTR1]]) @@ -176,7 +176,7 @@ void test3() { } // CHECK-LABEL: define{{.*}} i8* @test4() -id test4() { +id test4(void) { // Call to +alloc. // CHECK: load {{.*}}, {{.*}}* @"OBJC_CLASSLIST_REFERENCES_ // CHECK-NEXT: bitcast @@ -251,7 +251,7 @@ void test5(Test5 *x, id y) { id test6_helper(void) __attribute__((ns_returns_retained)); // CHECK-LABEL: define{{.*}} void @test6() -void test6() { +void test6(void) { // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* [[XPTR1]]) @@ -267,7 +267,7 @@ void test6() { void test7_helper(id __attribute__((ns_consumed))); // CHECK-LABEL: define{{.*}} void @test7() -void test7() { +void test7(void) { // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* // CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* [[XPTR1]]) @@ -285,7 +285,7 @@ void test7() { } id test8_helper(void) __attribute__((ns_returns_retained)); -void test8() { +void test8(void) { __unsafe_unretained id x = test8_helper(); // CHECK: [[X:%.*]] = alloca i8* // CHECK-NEXT: [[XPTR1:%.*]] = bitcast i8** [[X]] to i8* @@ -301,7 +301,7 @@ void test8() { @interface Test10 @property (retain) Test10 *me; @end -void test10() { +void test10(void) { Test10 *x; id y = x.me.me; @@ -498,7 +498,7 @@ void test13(void) { - (int) x { return super.x + 1; } @end -void test19() { +void test19(void) { // CHECK-LABEL: define{{.*}} void @test19() // CHECK: [[X:%.*]] = alloca [5 x i8*], align 16 // CHECK: call void @llvm.lifetime.start @@ -1146,7 +1146,7 @@ void test49(void) { } // rdar://9380136 -id x(); +id x(void); void test50(id y) { ({x();}); // CHECK: [[T0:%.*]] = call i8* @llvm.objc.retain diff --git a/clang/test/CodeGenObjC/attr-noreturn.m b/clang/test/CodeGenObjC/attr-noreturn.m index c413d05..c7618aa 100644 --- a/clang/test/CodeGenObjC/attr-noreturn.m +++ b/clang/test/CodeGenObjC/attr-noreturn.m @@ -25,7 +25,7 @@ void testInstanceMethod(Derived *x) { // CHECK: call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*)*)(i8* {{.*}}, i8* {{.*}}){{$}} // A direct call of a class method will normally never have a null receiver. -void testClassMethod() { +void testClassMethod(void) { [Derived abort]; } // CHECK-LABEL: @testClassMethod @@ -40,7 +40,7 @@ __attribute__((weak_import)) @end // The class pointer of a weakly-imported class may be null. -void testWeakImport() { +void testWeakImport(void) { [WeakDerived abort]; } // CHECK-LABEL: @testWeakImport diff --git a/clang/test/CodeGenObjC/attr-speculative-load-hardening.m b/clang/test/CodeGenObjC/attr-speculative-load-hardening.m index 3b4929d..e0a4e6a1 100644 --- a/clang/test/CodeGenObjC/attr-speculative-load-hardening.m +++ b/clang/test/CodeGenObjC/attr-speculative-load-hardening.m @@ -1,10 +1,10 @@ // RUN: %clang -emit-llvm %s -o - -S | FileCheck %s -check-prefix=SLH -int main() __attribute__((speculative_load_hardening)) { +int main(void) __attribute__((speculative_load_hardening)) { return 0; } -int test() __attribute__((no_speculative_load_hardening)) { +int test(void) __attribute__((no_speculative_load_hardening)) { return 0; } diff --git a/clang/test/CodeGenObjC/availability-cf-link-guard.m b/clang/test/CodeGenObjC/availability-cf-link-guard.m index dd599df..fcf532b 100644 --- a/clang/test/CodeGenObjC/availability-cf-link-guard.m +++ b/clang/test/CodeGenObjC/availability-cf-link-guard.m @@ -24,7 +24,7 @@ unsigned CFBundleGetVersionNumber(CFBundleRef bundle); #define CHECK_OS macos 10.12 #endif -void use_at_available() { +void use_at_available(void) { #ifdef DEF_CF CFBundleGetVersionNumber(0); #endif diff --git a/clang/test/CodeGenObjC/availability-check-maccatalyst.m b/clang/test/CodeGenObjC/availability-check-maccatalyst.m index 03ec8ed..b7e3dee 100644 --- a/clang/test/CodeGenObjC/availability-check-maccatalyst.m +++ b/clang/test/CodeGenObjC/availability-check-maccatalyst.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-ios13.1-macabi -emit-llvm -o - %s | FileCheck %s -void use_at_available() { +void use_at_available(void) { // CHECK: call i32 @__isPlatformVersionAtLeast(i32 2, i32 14, i32 0, i32 0) // CHECK-NEXT: icmp ne i32 if (__builtin_available(ios 14, *)) diff --git a/clang/test/CodeGenObjC/availability-check.m b/clang/test/CodeGenObjC/availability-check.m index 518afc4..eceaf97 100644 --- a/clang/test/CodeGenObjC/availability-check.m +++ b/clang/test/CodeGenObjC/availability-check.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-macosx10.11 -emit-llvm -o - %s | FileCheck %s -void use_at_available() { +void use_at_available(void) { // CHECK: call i32 @__isPlatformVersionAtLeast(i32 1, i32 10, i32 12, i32 0) // CHECK-NEXT: icmp ne if (__builtin_available(macos 10.12, *)) diff --git a/clang/test/CodeGenObjC/block-6.m b/clang/test/CodeGenObjC/block-6.m index 8e8e4f9..6d6ea7d 100644 --- a/clang/test/CodeGenObjC/block-6.m +++ b/clang/test/CodeGenObjC/block-6.m @@ -1,7 +1,7 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 | FileCheck %s // rdar://8893785 -void MYFUNC() { +void MYFUNC(void) { // CHECK-LABEL: define{{.*}} void @MYFUNC() // CHECK: [[OBSERVER_SLOT:%.*]] = alloca [[OBSERVER_T:%.*]], align 8 diff --git a/clang/test/CodeGenObjC/block-byref-debuginfo.m b/clang/test/CodeGenObjC/block-byref-debuginfo.m index 15ff53e..d815d8d 100644 --- a/clang/test/CodeGenObjC/block-byref-debuginfo.m +++ b/clang/test/CodeGenObjC/block-byref-debuginfo.m @@ -40,7 +40,7 @@ struct Foo2 { void (^bptr)(void); -int func() { +int func(void) { __attribute__((__blocks__(byref))) struct Foo foo; ^{ foo.data = 0; }(); __block struct Foo2 foo2; diff --git a/clang/test/CodeGenObjC/block-byref-variable-layout.m b/clang/test/CodeGenObjC/block-byref-variable-layout.m index a03617bc..3fa07db 100644 --- a/clang/test/CodeGenObjC/block-byref-variable-layout.m +++ b/clang/test/CodeGenObjC/block-byref-variable-layout.m @@ -3,13 +3,13 @@ // rdar://12759433 @class NSString; -void Test12759433() { +void Test12759433(void) { __block __unsafe_unretained NSString *uuByref = (__bridge NSString *)(void*)0x102030405060708; - void (^block)() = ^{ uuByref = 0; }; + void (^block)(void) = ^{ uuByref = 0; }; block(); } // CHECK: %struct.__block_byref_uuByref = type { i8*, %struct.__block_byref_uuByref*, i32, i32, [[ZERO:%.*]]* } -int main() { +int main(void) { __block __weak id wid; __block long XXX; __block id ID; @@ -19,7 +19,7 @@ int main() { void *pv; __unsafe_unretained id unsunr; } import; - void (^c)() = ^{ + void (^c)(void) = ^{ // Inline flag for BYREF variable layout (1107296256): BLOCK_BYREF_HAS_COPY_DISPOSE BLOCK_BYREF_LAYOUT_WEAK // CHECK: store i32 1107296256, i32* [[T0:%.*]] wid = 0; @@ -43,7 +43,7 @@ int main() { // rdar://12787751 typedef char mds_path_t[1024]; -void directVolumePerfWaitForStoreState() +void directVolumePerfWaitForStoreState(void) { __block mds_path_t path; } diff --git a/clang/test/CodeGenObjC/block-ptr-type-crash.m b/clang/test/CodeGenObjC/block-ptr-type-crash.m index 385d645..07f2267 100644 --- a/clang/test/CodeGenObjC/block-ptr-type-crash.m +++ b/clang/test/CodeGenObjC/block-ptr-type-crash.m @@ -10,7 +10,7 @@ enum AnEnum: uint64_t { AnEnumA }; -typedef void (^BlockType)(); +typedef void (^BlockType)(void); @interface MyClass @end @implementation MyClass diff --git a/clang/test/CodeGenObjC/block-var-layout.m b/clang/test/CodeGenObjC/block-var-layout.m index 00409f3..27fbcb3 100644 --- a/clang/test/CodeGenObjC/block-var-layout.m +++ b/clang/test/CodeGenObjC/block-var-layout.m @@ -17,9 +17,9 @@ __weak id wid; void x(id y) {} void y(int a) {} -extern id opaque_id(); +extern id opaque_id(void); -void f() { +void f(void) { __block int byref_int = 0; char ch = 'a'; char ch1 = 'b'; @@ -48,7 +48,7 @@ void f() { // Test 1 // byref int, short, char, char, char, id, id, strong void*, byref id // CHECK-LP64: block variable layout for block: 0x01, 0x35, 0x10, 0x00 - void (^b)() = ^{ + void (^b)(void) = ^{ byref_int = sh + ch+ch1+ch2 ; x(bar); x(baz); @@ -61,7 +61,7 @@ void f() { // byref int, short, char, char, char, id, id, strong void*, byref void*, byref id // 01 36 10 00 // CHECK-LP64: block variable layout for block: 0x01, 0x36, 0x10, 0x00 - void (^c)() = ^{ + void (^c)(void) = ^{ byref_int = sh + ch+ch1+ch2 ; x(bar); x(baz); @@ -77,7 +77,7 @@ void f() { // 01 34 11 30 00 // FIXME: we'd get a better format here if we sorted by scannability, not just alignment // CHECK-LP64: block variable layout for block: 0x01, 0x35, 0x30, 0x00 - void (^d)() = ^{ + void (^d)(void) = ^{ byref_int = sh + ch+ch1+ch2 ; x(bar); x(baz); @@ -93,14 +93,14 @@ void f() { // 01 41 11 11 00 // CHECK-LP64: block variable layout for block: 0x01, 0x41, 0x11, 0x11, 0x00 struct S s2; - void (^e)() = ^{ + void (^e)(void) = ^{ x(s2.o1); }; e(); } // Test 5 (unions/structs and their nesting): -void Test5() { +void Test5(void) { struct S5 { int i1; id o1; @@ -130,7 +130,7 @@ void Test5() { // struct s2 (int, id, int, id, int, id?), union u2 (id?) // 01 41 11 12 00 // CHECK-LP64: block variable layout for block: 0x01, 0x41, 0x11, 0x12, 0x00 - void (^c)() = ^{ + void (^c)(void) = ^{ x(s2.ui.o1); x(u2.o1); }; @@ -142,12 +142,12 @@ void CFRelease(id); void notifyBlock(id dependentBlock) { id singleObservationToken; id token; - void (^b)(); + void (^b)(void); -// id, id, void(^)() +// id, id, void(^)(void) // 01 33 00 // CHECK-LP64: block variable layout for block: 0x01, 0x33, 0x00 - void (^wrapperBlock)() = ^() { + void (^wrapperBlock)(void) = ^(void) { CFRelease(singleObservationToken); CFRelease(singleObservationToken); CFRelease(token); @@ -157,10 +157,10 @@ void notifyBlock(id dependentBlock) { wrapperBlock(); } -void test_empty_block() { +void test_empty_block(void) { // 01 00 // CHECK-LP64: block variable layout for block: 0x01, 0x30, 0x00 - void (^wrapperBlock)() = ^() { + void (^wrapperBlock)(void) = ^(void) { }; wrapperBlock(); } @@ -168,7 +168,7 @@ void test_empty_block() { // rdar://16111839 typedef union { char ch[8]; } SS; typedef struct { SS s[4]; } CS; -void test_union_in_layout() { +void test_union_in_layout(void) { CS cs; ^{ cs; }; } diff --git a/clang/test/CodeGenObjC/blocks-1.m b/clang/test/CodeGenObjC/blocks-1.m index 6278756..4974abd 100644 --- a/clang/test/CodeGenObjC/blocks-1.m +++ b/clang/test/CodeGenObjC/blocks-1.m @@ -36,7 +36,7 @@ void test1(NSDictionary * dict) { @interface D @end -void foo() { +void foo(void) { __block __weak D *weakSelf; ^{ (void)weakSelf; }; D *l; @@ -46,7 +46,7 @@ void foo() { void (^__weak b)(void); -void test2() { +void test2(void) { __block int i = 0; b = ^ { ++i; }; } diff --git a/clang/test/CodeGenObjC/blocks-2.m b/clang/test/CodeGenObjC/blocks-2.m index 512c8d8..9d2e411 100644 --- a/clang/test/CodeGenObjC/blocks-2.m +++ b/clang/test/CodeGenObjC/blocks-2.m @@ -15,7 +15,7 @@ id test0(id x) { // : cleanup __block variables on EH path // CHECK: define{{.*}} void @{{.*}}test1 -void test1() { +void test1(void) { extern void test1_help(void (^x)(void)); // CHECK: [[N:%.*]] = alloca [[N_T:%.*]], align 8 diff --git a/clang/test/CodeGenObjC/blocks-3.m b/clang/test/CodeGenObjC/blocks-3.m index a7edc12..001f371 100644 --- a/clang/test/CodeGenObjC/blocks-3.m +++ b/clang/test/CodeGenObjC/blocks-3.m @@ -8,14 +8,14 @@ // RUN: grep 'object_dispose' %t | count 29 -int main() { +int main(void) { typedef id aid __attribute__((aligned(1))); __block aid a1; __block id a2 __attribute__((aligned(2))); __block id a3 __attribute__((aligned(4))); __block id a4 __attribute__((aligned(8))); __block id a5, a6, a7; - __block void (^b)(); + __block void (^b)(void); ^{ a1=a2=a3=a4=a5=a6=a7=0; b = 0; }(); return 0; } diff --git a/clang/test/CodeGenObjC/blocks-4.m b/clang/test/CodeGenObjC/blocks-4.m index f5af9bc..cf08467 100644 --- a/clang/test/CodeGenObjC/blocks-4.m +++ b/clang/test/CodeGenObjC/blocks-4.m @@ -8,7 +8,7 @@ void EXIT(id e); +(id)blockOperationWithBlock:(void (^)(void))block ; @end -void FUNC() { +void FUNC(void) { [NSBlockOperation blockOperationWithBlock:^{ @try { diff --git a/clang/test/CodeGenObjC/blocks-5.m b/clang/test/CodeGenObjC/blocks-5.m index 18adb0f..d7d0ffe 100644 --- a/clang/test/CodeGenObjC/blocks-5.m +++ b/clang/test/CodeGenObjC/blocks-5.m @@ -11,7 +11,7 @@ -int foo(); +int foo(void); extern void DVT (volatile const void * object, volatile const void * selector, const char * functionName); @implementation IDEWorkspaceDocument diff --git a/clang/test/CodeGenObjC/boxing.m b/clang/test/CodeGenObjC/boxing.m index 7e0d4ef..42e8ddb 100644 --- a/clang/test/CodeGenObjC/boxing.m +++ b/clang/test/CodeGenObjC/boxing.m @@ -71,7 +71,7 @@ typedef signed char BOOL; // CHECK: [[STR0:.*]] = private unnamed_addr constant [4 x i8] c"abc\00", section "__TEXT,__cstring,cstring_literals", align 1 // CHECK: [[UNNAMED_CFSTRING:.*]] = private global [[STRUCT_NSCONSTANT_STRING_TAG]] { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[STR0]], i32 0, i32 0), i64 3 }, section "__DATA,__cfstring", align 8 -int main() { +int main(void) { // CHECK: [[T:%.*]] = alloca [[V0]]*, align 8 // CHECK: load i8*, i8** [[WithIntSEL]] diff --git a/clang/test/CodeGenObjC/catch-lexical-block.m b/clang/test/CodeGenObjC/catch-lexical-block.m index a06aa83..a7f5b36 100644 --- a/clang/test/CodeGenObjC/catch-lexical-block.m +++ b/clang/test/CodeGenObjC/catch-lexical-block.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -debug-info-kind=limited -fobjc-exceptions -emit-llvm %s -o - | FileCheck %s @interface Foo @end -void f0() { +void f0(void) { @try { @throw @"a"; } @catch(Foo *e) { diff --git a/clang/test/CodeGenObjC/class-stubs.m b/clang/test/CodeGenObjC/class-stubs.m index 31f423f..4e1be45 100644 --- a/clang/test/CodeGenObjC/class-stubs.m +++ b/clang/test/CodeGenObjC/class-stubs.m @@ -36,7 +36,7 @@ __attribute__((objc_subclassing_restricted)) @interface Derived : Base @end -int main() { +int main(void) { [Base classMethod]; } // CHECK-LABEL: define{{.*}} i32 @main() diff --git a/clang/test/CodeGenObjC/constant-string-class.m b/clang/test/CodeGenObjC/constant-string-class.m index 63f7f67..6b55ad7 100644 --- a/clang/test/CodeGenObjC/constant-string-class.m +++ b/clang/test/CodeGenObjC/constant-string-class.m @@ -25,7 +25,7 @@ id _FooClassReference[20]; - (char *)customString { return cString ; } @end -int main () { +int main (void) { Foo *string = @"bla"; return 0; } diff --git a/clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m b/clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m index 4a415be..b7dc536 100644 --- a/clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m +++ b/clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m @@ -39,7 +39,7 @@ void test1(id x) { } // CHECK-LABEL: define {{.*}}void @check_invoke -void check_invoke() { +void check_invoke(void) { // MSGS: {{invoke.*@objc_msgSend}} // MSGS: {{invoke.*@objc_msgSend}} // CALLS: {{invoke.*@objc_alloc}} @@ -77,7 +77,7 @@ void test2(void* x) { // Make sure we get a bitcast on the return type as the // call will return i8* which we have to cast to A* // CHECK-LABEL: define {{.*}}void @test_alloc_class_ptr -A* test_alloc_class_ptr() { +A* test_alloc_class_ptr(void) { // CALLS: {{call.*@objc_alloc}} // CALLS-NEXT: bitcast i8* // CALLS-NEXT: ret @@ -87,7 +87,7 @@ A* test_alloc_class_ptr() { // Make sure we get a bitcast on the return type as the // call will return i8* which we have to cast to A* // CHECK-LABEL: define {{.*}}void @test_alloc_class_ptr -A* test_allocWithZone_class_ptr() { +A* test_allocWithZone_class_ptr(void) { // CALLS: {{call.*@objc_allocWithZone}} // CALLS-NEXT: bitcast i8* // CALLS-NEXT: ret @@ -135,7 +135,7 @@ A* test_autorelease_class_ptr(B *b) { // Make sure we only accept pointer types // CHECK-LABEL: define {{.*}}void @test_allocWithZone_int -C* test_allocWithZone_int() { +C* test_allocWithZone_int(void) { // MSGS: {{call.*@objc_msgSend}} // CALLS: {{call.*@objc_msgSend}} return [C allocWithZone:3]; @@ -237,7 +237,7 @@ void testException_retain(NSObject *a) { // CHECK-LABEL: define {{.*}}void @testException_alloc( -void testException_alloc() { +void testException_alloc(void) { @try { // MSGS: {{invoke.*@objc_msgSend}} // CALLS: invoke{{.*}}@objc_alloc(i8* % @@ -247,7 +247,7 @@ void testException_alloc() { } // CHECK-LABEL: define {{.*}}void @testException_allocWithZone -void testException_allocWithZone() { +void testException_allocWithZone(void) { @try { // MSGS: {{invoke.*@objc_msgSend}} // CALLS: invoke{{.*}}@objc_allocWithZone(i8* % diff --git a/clang/test/CodeGenObjC/debug-info-block-type.m b/clang/test/CodeGenObjC/debug-info-block-type.m index 4bdd180..943dfd5 100644 --- a/clang/test/CodeGenObjC/debug-info-block-type.m +++ b/clang/test/CodeGenObjC/debug-info-block-type.m @@ -12,7 +12,7 @@ typedef signed char BOOL; // CHECK: ![[ID]] = !DIDerivedType(tag: DW_TAG_typedef, name: "id" typedef BOOL (^SomeKindOfPredicate)(id obj); -int main() +int main(void) { SomeKindOfPredicate p = ^BOOL(id obj) { return obj != nil; }; // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "__FuncPtr", diff --git a/clang/test/CodeGenObjC/debug-info-blocks.m b/clang/test/CodeGenObjC/debug-info-blocks.m index 5694862..70fcfdb 100644 --- a/clang/test/CodeGenObjC/debug-info-blocks.m +++ b/clang/test/CodeGenObjC/debug-info-blocks.m @@ -76,7 +76,7 @@ static void run(void (^block)(void)) @end -int main() +int main(void) { A *a = [[A alloc] init]; return 0; diff --git a/clang/test/CodeGenObjC/debug-info-getter-name.m b/clang/test/CodeGenObjC/debug-info-getter-name.m index 7915a2f..3e0f52b 100644 --- a/clang/test/CodeGenObjC/debug-info-getter-name.m +++ b/clang/test/CodeGenObjC/debug-info-getter-name.m @@ -48,7 +48,7 @@ } @end -int main() +int main(void) { return 0; } diff --git a/clang/test/CodeGenObjC/debug-info-id-with-protocol.m b/clang/test/CodeGenObjC/debug-info-id-with-protocol.m index 8974e27..38f69ef 100644 --- a/clang/test/CodeGenObjC/debug-info-id-with-protocol.m +++ b/clang/test/CodeGenObjC/debug-info-id-with-protocol.m @@ -26,7 +26,7 @@ void NSLog(id, ...); @implementation MyClass @end -int main() +int main(void) { @autoreleasepool { diff --git a/clang/test/CodeGenObjC/debug-info-ivars-indirect.m b/clang/test/CodeGenObjC/debug-info-ivars-indirect.m index b227bc6..6b13fbf 100644 --- a/clang/test/CodeGenObjC/debug-info-ivars-indirect.m +++ b/clang/test/CodeGenObjC/debug-info-ivars-indirect.m @@ -38,7 +38,7 @@ void gorf (struct S* s) { } -I *source(); +I *source(void); @interface I() { @@ -46,7 +46,7 @@ I *source(); } @end -void use() { +void use(void) { int _c = source()->c; } @@ -56,4 +56,4 @@ void use() { } @end -I *x(); +I *x(void); diff --git a/clang/test/CodeGenObjC/debug-info-property-accessors.m b/clang/test/CodeGenObjC/debug-info-property-accessors.m index d050100..1a12224 100644 --- a/clang/test/CodeGenObjC/debug-info-property-accessors.m +++ b/clang/test/CodeGenObjC/debug-info-property-accessors.m @@ -44,7 +44,7 @@ typedef unsigned int NSUInteger; @end int -main () +main (void) { Bar *my_bar = [[Bar alloc] init]; diff --git a/clang/test/CodeGenObjC/debug-property-synth.m b/clang/test/CodeGenObjC/debug-property-synth.m index ddcf4d9..b76fd8a 100644 --- a/clang/test/CodeGenObjC/debug-property-synth.m +++ b/clang/test/CodeGenObjC/debug-property-synth.m @@ -29,7 +29,7 @@ @synthesize p1 = _p1; @end -int main() { +int main(void) { I *myi; myi.p1 = 2; return myi.p1; diff --git a/clang/test/CodeGenObjC/dllstorage.m b/clang/test/CodeGenObjC/dllstorage.m index da90824..64ba21f 100644 --- a/clang/test/CodeGenObjC/dllstorage.m +++ b/clang/test/CodeGenObjC/dllstorage.m @@ -124,7 +124,7 @@ id f(Q *q) { // CHECK-IR-DAG: @"OBJC_IVAR_$_M._ivar" = external dllimport global i32 -int g() { +int g(void) { @autoreleasepool { M *mi = [M new]; @try { diff --git a/clang/test/CodeGenObjC/dot-syntax-1.m b/clang/test/CodeGenObjC/dot-syntax-1.m index 417bcb4..537d8ec 100644 --- a/clang/test/CodeGenObjC/dot-syntax-1.m +++ b/clang/test/CodeGenObjC/dot-syntax-1.m @@ -244,7 +244,7 @@ int printf(const char *, ...); // FIXME: Two more (thats it?) interesting cases. Method access on // getter w/o setter and method access on setter w/o getter. -int main() { +int main(void) { #define test(N) { \ Bot##N *ob = [[Bot##N alloc] init]; \ int x = ob.x; \ diff --git a/clang/test/CodeGenObjC/dot-syntax.m b/clang/test/CodeGenObjC/dot-syntax.m index 6282ea4..411b095 100644 --- a/clang/test/CodeGenObjC/dot-syntax.m +++ b/clang/test/CodeGenObjC/dot-syntax.m @@ -57,7 +57,7 @@ typedef struct { @end -int main() { +int main(void) { #define SWAP(T,a,b) { T a_tmp = a; a = b; b = a_tmp; } A *a = [[A alloc] init]; A *b = [[A alloc] init]; diff --git a/clang/test/CodeGenObjC/empty-collection-literals.m b/clang/test/CodeGenObjC/empty-collection-literals.m index 44775bc..dec4ffa 100644 --- a/clang/test/CodeGenObjC/empty-collection-literals.m +++ b/clang/test/CodeGenObjC/empty-collection-literals.m @@ -12,7 +12,7 @@ #include "literal-support.h" -void test_empty_array() { +void test_empty_array(void) { // CHECK-WITHOUT-EMPTY-COLLECTIONS-LABEL: define{{.*}} void @test_empty_array // CHECK-WITHOUT-EMPTY-COLLECTIONS-NOT: ret void // CHECK-WITHOUT-EMPTY-COLLECTIONS: {{call.*objc_msgSend}} @@ -31,7 +31,7 @@ void test_empty_array() { NSArray *arr = @[]; } -void test_empty_dictionary() { +void test_empty_dictionary(void) { // CHECK-WITHOUT-EMPTY-COLLECTIONS-LABEL: define{{.*}} void @test_empty_dictionary // CHECK-WITHOUT-EMPTY-COLLECTIONS-NOT: ret void // CHECK-WITHOUT-EMPTY-COLLECTIONS: {{call.*objc_msgSend}} diff --git a/clang/test/CodeGenObjC/encode-test-2.m b/clang/test/CodeGenObjC/encode-test-2.m index 2d9593d..eea8ad4 100644 --- a/clang/test/CodeGenObjC/encode-test-2.m +++ b/clang/test/CodeGenObjC/encode-test-2.m @@ -28,7 +28,7 @@ Class IVAR_Classx; @implementation Intf @end -int main() +int main(void) { const char * en = @encode(Intf); } diff --git a/clang/test/CodeGenObjC/encode-test-3.m b/clang/test/CodeGenObjC/encode-test-3.m index b76063ff..0856b77 100644 --- a/clang/test/CodeGenObjC/encode-test-3.m +++ b/clang/test/CodeGenObjC/encode-test-3.m @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o - %s | FileCheck %s -int main() { +int main(void) { int n; const char * inc = @encode(int[]); diff --git a/clang/test/CodeGenObjC/encode-test-4.m b/clang/test/CodeGenObjC/encode-test-4.m index 2624bc7..ac58fc3 100644 --- a/clang/test/CodeGenObjC/encode-test-4.m +++ b/clang/test/CodeGenObjC/encode-test-4.m @@ -3,7 +3,7 @@ typedef long Integer; typedef enum : Integer { Red, Green, Blue} Color; typedef enum { Cyan, Magenta, Yellow, Key } PrintColor; -int a() { +int a(void) { return @encode(int) == @encode(int) && @encode(Color) == @encode(long) && @encode(PrintColor) == @encode(int); diff --git a/clang/test/CodeGenObjC/encode-test-6.m b/clang/test/CodeGenObjC/encode-test-6.m index ff7016c..0668e9f 100644 --- a/clang/test/CodeGenObjC/encode-test-6.m +++ b/clang/test/CodeGenObjC/encode-test-6.m @@ -57,7 +57,7 @@ typedef struct // rdar://16655340 int i; typeof(@encode(typeof(i))) e = @encode(typeof(i)); -const char * Test() +const char * Test(void) { return e; } diff --git a/clang/test/CodeGenObjC/encode-test.m b/clang/test/CodeGenObjC/encode-test.m index c86a5ab..4ac0c58 100644 --- a/clang/test/CodeGenObjC/encode-test.m +++ b/clang/test/CodeGenObjC/encode-test.m @@ -83,7 +83,7 @@ struct S { int iS; }; @end typedef Object MyObj; -int main() +int main(void) { const char *en = @encode(Derived); const char *eb = @encode(B1); @@ -188,7 +188,7 @@ size_t strlen(const char *s); // CHECK: %[[i:.*]] = alloca i32 // CHECK: %[[call:.*]] = call i32 @strlen // CHECK: store i32 %[[call]], i32* %[[i]] -void test_strlen() { +void test_strlen(void) { const char array[] = @encode(int); int i = strlen(array); } diff --git a/clang/test/CodeGenObjC/exceptions-asm-attribute.m b/clang/test/CodeGenObjC/exceptions-asm-attribute.m index b4679ef..3344c47 100644 --- a/clang/test/CodeGenObjC/exceptions-asm-attribute.m +++ b/clang/test/CodeGenObjC/exceptions-asm-attribute.m @@ -71,7 +71,7 @@ __attribute__((__objc_exception__)) @interface EH3 @end -void f1(); +void f1(void); void f0(id x) { @try { diff --git a/clang/test/CodeGenObjC/exceptions-nonfragile.m b/clang/test/CodeGenObjC/exceptions-nonfragile.m index bc4c809..ce718bf 100644 --- a/clang/test/CodeGenObjC/exceptions-nonfragile.m +++ b/clang/test/CodeGenObjC/exceptions-nonfragile.m @@ -3,8 +3,8 @@ // rdar://problem/8535238 // CHECK: declare void @objc_exception_rethrow() -void protos() { - extern void foo(); +void protos(void) { + extern void foo(void); @try { foo(); } @catch (id e) { @@ -12,7 +12,7 @@ void protos() { } } -void throwing() { +void throwing(void) { @throw(@"error!"); } diff --git a/clang/test/CodeGenObjC/exceptions.m b/clang/test/CodeGenObjC/exceptions.m index f3505f8..e02014b 100644 --- a/clang/test/CodeGenObjC/exceptions.m +++ b/clang/test/CodeGenObjC/exceptions.m @@ -4,7 +4,7 @@ // Just check that we don't emit any dead blocks. @interface NSArray @end -void f0() { +void f0(void) { @try { @try { @throw @"a"; @@ -15,7 +15,7 @@ void f0() { } // CHECK-LABEL: define{{.*}} void @f1() -void f1() { +void f1(void) { extern void foo(void); while (1) { @@ -41,7 +41,7 @@ void f1() { // optimization. rdar://problem/8160285 // CHECK-LABEL: define{{.*}} i32 @f2() -int f2() { +int f2(void) { extern void foo(void); // CHECK: [[X:%.*]] = alloca i32 @@ -76,7 +76,7 @@ int f2() { // Test that the cleanup destination is saved when entering a finally // block. rdar://problem/8293901 // CHECK-LABEL: define{{.*}} void @f3() -void f3() { +void f3(void) { extern void f3_helper(int, int*); // CHECK: [[X:%.*]] = alloca i32 @@ -128,7 +128,7 @@ void f3() { } // rdar://problem/8440970 -void f4() { +void f4(void) { extern void f4_help(int); // CHECK-LABEL: define{{.*}} void @f4() diff --git a/clang/test/CodeGenObjC/extended-block-signature-encode.m b/clang/test/CodeGenObjC/extended-block-signature-encode.m index 3db31fa..0f9b0d4 100644 --- a/clang/test/CodeGenObjC/extended-block-signature-encode.m +++ b/clang/test/CodeGenObjC/extended-block-signature-encode.m @@ -6,7 +6,7 @@ typedef NSString*(^BBB)(NSArray*); -int main () +int main (void) { BBB b1; ^(BBB arg1, double arg2){ return b1; }(0, 3.14); diff --git a/clang/test/CodeGenObjC/externally-retained.m b/clang/test/CodeGenObjC/externally-retained.m index 2d6cb10..cf2c6fc 100644 --- a/clang/test/CodeGenObjC/externally-retained.m +++ b/clang/test/CodeGenObjC/externally-retained.m @@ -25,14 +25,14 @@ void param(ObjTy *p) EXT_RET { // CHECK: ret } -void local() { +void local(void) { EXT_RET ObjTy *local = global; // CHECK-LABEL: define{{.*}} void @local // CHECK-NOT: llvm.objc. // CHECK: ret } -void in_init() { +void in_init(void) { // Test that we do the right thing when a variable appears in it's own // initializer. Here, we release the value stored in 'wat' after overwriting // it, in case it was somehow set to point to a non-null object while it's @@ -52,7 +52,7 @@ void in_init() { // CHECK: ret } -void esc(void (^)()); +void esc(void (^)(void)); void block_capture(ObjTy *obj) EXT_RET { esc(^{ (void)obj; }); @@ -82,7 +82,7 @@ void block_capture(ObjTy *obj) EXT_RET { void escp(void (^)(ObjTy *)); -void block_param() { +void block_param(void) { escp(^(ObjTy *p) EXT_RET {}); // CHECK-LABEL: define internal void @__block_param_block_invoke diff --git a/clang/test/CodeGenObjC/for-in.m b/clang/test/CodeGenObjC/for-in.m index ed618e0..e765426 100644 --- a/clang/test/CodeGenObjC/for-in.m +++ b/clang/test/CodeGenObjC/for-in.m @@ -20,7 +20,7 @@ void p(const char*, ...); #define L6(n) L5(n+0),L5(n+32) // CHECK-LABEL: define{{.*}} void @t0 -void t0() { +void t0(void) { NSArray *array = [NSArray arrayWithObjects: L1(0), (void*)0]; p("array.length: %d\n", [array count]); @@ -43,7 +43,7 @@ void t0() { } } -void t1() { +void t1(void) { NSArray *array = [NSArray arrayWithObjects: L6(0), (void*)0]; p("array.length: %d\n", [array count]); diff --git a/clang/test/CodeGenObjC/forward-protocol-metadata-symbols.m b/clang/test/CodeGenObjC/forward-protocol-metadata-symbols.m index 4d81b9e..0ec8c2f 100644 --- a/clang/test/CodeGenObjC/forward-protocol-metadata-symbols.m +++ b/clang/test/CodeGenObjC/forward-protocol-metadata-symbols.m @@ -13,7 +13,7 @@ +(Class) getClass { return self; } @end -int main() { +int main(void) { Protocol *P0 = @protocol(P0); return 0; } diff --git a/clang/test/CodeGenObjC/fp2ret.m b/clang/test/CodeGenObjC/fp2ret.m index 93f8992..58fb278 100644 --- a/clang/test/CodeGenObjC/fp2ret.m +++ b/clang/test/CodeGenObjC/fp2ret.m @@ -23,6 +23,6 @@ // CHECK-ARMV7-LABEL: define{{.*}} void @t0() // CHECK-ARMV7: call i128 bitcast {{.*}} @objc_msgSend to // CHECK-ARMV7: } -void t0() { +void t0(void) { [(A*)0 complexLongDoubleValue]; } diff --git a/clang/test/CodeGenObjC/fpret.m b/clang/test/CodeGenObjC/fpret.m index 07841c5..a7e89f7 100644 --- a/clang/test/CodeGenObjC/fpret.m +++ b/clang/test/CodeGenObjC/fpret.m @@ -31,7 +31,7 @@ // CHECK-ARMV7: call double bitcast {{.*}} @objc_msgSend to // CHECK-ARMV7: call double bitcast {{.*}} @objc_msgSend to // CHECK-ARMV7: } -void t0() { +void t0(void) { [(A*)0 floatValue]; [(A*)0 doubleValue]; [(A*)0 longDoubleValue]; diff --git a/clang/test/CodeGenObjC/fragile-arc.m b/clang/test/CodeGenObjC/fragile-arc.m index 8a46292..82b8013 100644 --- a/clang/test/CodeGenObjC/fragile-arc.m +++ b/clang/test/CodeGenObjC/fragile-arc.m @@ -163,7 +163,7 @@ void testBlockLayoutWeak(__weak id x) { // CHECK: call void @checkpoint(i32 noundef 2) // CHECK: call void @llvm.objc.storeStrong(i8** [[Y]], i8* null) extern void checkpoint(int n); -void testCatch() { +void testCatch(void) { @try { checkpoint(0); } @catch (A *x) { diff --git a/clang/test/CodeGenObjC/gnu-deterministic-selectors.m b/clang/test/CodeGenObjC/gnu-deterministic-selectors.m index 5f8d2e53..5201915 100644 --- a/clang/test/CodeGenObjC/gnu-deterministic-selectors.m +++ b/clang/test/CodeGenObjC/gnu-deterministic-selectors.m @@ -7,7 +7,7 @@ // CHECK: @.objc_selector_list = internal global [6 x { i8*, i8* }] [{ i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namea, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_nameg, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namej, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namel, i64 0, i64 0), i8* null }, { i8*, i8* } { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.objc_sel_namez, i64 0, i64 0), i8* null }, { i8*, i8* } zeroinitializer], align 8 -void f() { +void f(void) { SEL a = @selector(z); SEL b = @selector(a); SEL c = @selector(g); diff --git a/clang/test/CodeGenObjC/gnu-exceptions.m b/clang/test/CodeGenObjC/gnu-exceptions.m index d441e98..71250c9 100644 --- a/clang/test/CodeGenObjC/gnu-exceptions.m +++ b/clang/test/CodeGenObjC/gnu-exceptions.m @@ -8,7 +8,7 @@ void log(int i); // CHECK: define{{.*}} void @test0() [[TF:#[0-9]+]] // CHECK-SAME: personality i8* bitcast (i32 (...)* @__gnu_objc_personality_v0 to i8*) -void test0() { +void test0(void) { @try { // CHECK: invoke void @opaque() opaque(); diff --git a/clang/test/CodeGenObjC/gnustep2-proto.m b/clang/test/CodeGenObjC/gnustep2-proto.m index 4804327..21ff027 100644 --- a/clang/test/CodeGenObjC/gnustep2-proto.m +++ b/clang/test/CodeGenObjC/gnustep2-proto.m @@ -33,7 +33,7 @@ // CHECK: define{{.*}} i8* @x() // CHECK: = load // CHECK-SAME: @._OBJC_REF_PROTOCOL_X, align 8 -void *x() +void *x(void) { return @protocol(X); } diff --git a/clang/test/CodeGenObjC/hidden-visibility.m b/clang/test/CodeGenObjC/hidden-visibility.m index 4969f5c..52ca2bc 100644 --- a/clang/test/CodeGenObjC/hidden-visibility.m +++ b/clang/test/CodeGenObjC/hidden-visibility.m @@ -18,7 +18,7 @@ @protocol Prot0 @end -id f0() { +id f0(void) { return @protocol(Prot0); } diff --git a/clang/test/CodeGenObjC/id-isa-codegen.m b/clang/test/CodeGenObjC/id-isa-codegen.m index 20f344c..ac6d9b7 100644 --- a/clang/test/CodeGenObjC/id-isa-codegen.m +++ b/clang/test/CodeGenObjC/id-isa-codegen.m @@ -44,7 +44,7 @@ Class Test(const void *inObject1) { +(id)method; @end -id Test2() { +id Test2(void) { if([Foo method]->isa) return (*[Foo method]).isa; return [Foo method]->isa; diff --git a/clang/test/CodeGenObjC/initialize-function-static.m b/clang/test/CodeGenObjC/initialize-function-static.m index 21ad320..d6836db 100644 --- a/clang/test/CodeGenObjC/initialize-function-static.m +++ b/clang/test/CodeGenObjC/initialize-function-static.m @@ -3,7 +3,7 @@ @interface I @end -I *i() { +I *i(void) { static I *i = ((void *)0); return i; } diff --git a/clang/test/CodeGenObjC/ivar-type-encoding.m b/clang/test/CodeGenObjC/ivar-type-encoding.m index a7ad55c..3d9cf25 100644 --- a/clang/test/CodeGenObjC/ivar-type-encoding.m +++ b/clang/test/CodeGenObjC/ivar-type-encoding.m @@ -24,7 +24,7 @@ @end -int main() { +int main(void) { TestClass *c = [TestClass new]; return 0; } diff --git a/clang/test/CodeGenObjC/link-errors.m b/clang/test/CodeGenObjC/link-errors.m index 44797d9..0822562 100644 --- a/clang/test/CodeGenObjC/link-errors.m +++ b/clang/test/CodeGenObjC/link-errors.m @@ -29,7 +29,7 @@ @end -int main() { +int main(void) { id x = @protocol(P); [ A alloc ]; [ A foo ]; diff --git a/clang/test/CodeGenObjC/local-static-block.m b/clang/test/CodeGenObjC/local-static-block.m index d656962..a86c663 100644 --- a/clang/test/CodeGenObjC/local-static-block.m +++ b/clang/test/CodeGenObjC/local-static-block.m @@ -21,7 +21,7 @@ static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSA extern NSArray *address; extern unsigned long level; -void FUNC() +void FUNC(void) { ArrayRecurs(address, level); @@ -50,7 +50,7 @@ void FUNC() } } -void FUNC2() { +void FUNC2(void) { static void (^const block1)(int) = ^(int a){ if (a--) block1(a); @@ -61,7 +61,7 @@ void FUNC2() { // CHECK: define internal void @_block_invoke{{.*}}( // CHECK: call void %{{.*}}(i8* noundef bitcast ({ i8**, i32, i32, i8*, %struct.__block_descriptor* }* @__block_literal_global{{.*}} to i8*), i32 noundef %{{.*}}) -void FUNC1() +void FUNC1(void) { static NSArray *(^ArrayRecurs)(NSArray *addresses, unsigned long level) = ^(NSArray *addresses, unsigned long level) { diff --git a/clang/test/CodeGenObjC/metadata-symbols-32.m b/clang/test/CodeGenObjC/metadata-symbols-32.m index 9f728ef..825b2c6 100644 --- a/clang/test/CodeGenObjC/metadata-symbols-32.m +++ b/clang/test/CodeGenObjC/metadata-symbols-32.m @@ -80,7 +80,7 @@ llvm-gcc -m32 -emit-llvm -S -o - metadata-symbols-32.m | \ @implementation J0(Category) @end -void *f0() { +void *f0(void) { [B im0]; [C im1]; } diff --git a/clang/test/CodeGenObjC/metadata_symbols.m b/clang/test/CodeGenObjC/metadata_symbols.m index 697fa9a..6ff5294 100644 --- a/clang/test/CodeGenObjC/metadata_symbols.m +++ b/clang/test/CodeGenObjC/metadata_symbols.m @@ -66,7 +66,7 @@ __attribute__((__objc_exception__)) @interface EH3 @end -void f1(); +void f1(void); void f0(id x) { @try { diff --git a/clang/test/CodeGenObjC/mrc-weak.m b/clang/test/CodeGenObjC/mrc-weak.m index 4c2e64c..95811d9 100644 --- a/clang/test/CodeGenObjC/mrc-weak.m +++ b/clang/test/CodeGenObjC/mrc-weak.m @@ -177,7 +177,7 @@ void test9(void) { __unsafe_unretained Foo *p = get_object(); use_block(^{ [p run]; }); } -void test9_fin() {} +void test9_fin(void) {} // CHECK-LABEL: define{{.*}} void @test10() // CHECK-NOT: define linkonce_odr hidden void @__copy_helper @@ -188,4 +188,4 @@ void test10(void) { UnsafeFooPtr p = get_object(); use_block(^{ [p run]; }); } -void test10_fin() {} +void test10_fin(void) {} diff --git a/clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m b/clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m index c196e5d..9ea2e19 100644 --- a/clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m +++ b/clang/test/CodeGenObjC/mrr-captured-block-var-inlined-layout.m @@ -8,10 +8,10 @@ void x(id y) {} void y(int a) {} -extern id opaque_id(); +extern id opaque_id(void); __weak id wid; -void f() { +void f(void) { __block int byref_int = 0; const id bar = (id) opaque_id(); id baz = 0; @@ -21,13 +21,13 @@ void f() { // block variable layout: BL_STRONG:1, BL_OPERATOR:0 // CHECK: Inline block variable layout: 0x0100, BL_STRONG:1, BL_OPERATOR:0 - void (^b)() = ^{ + void (^b)(void) = ^{ x(bar); }; // block variable layout: BL_STRONG:2, BL_BYREF:1, BL_OPERATOR:0 // CHECK: Inline block variable layout: 0x0210, BL_STRONG:2, BL_BYREF:1, BL_OPERATOR:0 - void (^c)() = ^{ + void (^c)(void) = ^{ x(bar); x(baz); byref_int = 1; @@ -35,7 +35,7 @@ void f() { // block variable layout: BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0 // CHECK: Inline block variable layout: 0x0230, BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0 - void (^d)() = ^{ + void (^d)(void) = ^{ x(bar); x(baz); byref_int = 1; @@ -45,7 +45,7 @@ void f() { // block variable layout: BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0 // CHECK: Inline block variable layout: 0x0230, BL_STRONG:2, BL_BYREF:3, BL_OPERATOR:0 - id (^e)() = ^{ + id (^e)(void) = ^{ x(bar); x(baz); byref_int = 1; @@ -55,7 +55,7 @@ void f() { }; // CHECK: Inline block variable layout: 0x020, BL_BYREF:2, BL_OPERATOR:0 - void (^ii)() = ^{ + void (^ii)(void) = ^{ byref_int = 1; byref_bab = 0; }; diff --git a/clang/test/CodeGenObjC/nested-rethrow.m b/clang/test/CodeGenObjC/nested-rethrow.m index bff52c3..e25793c 100644 --- a/clang/test/CodeGenObjC/nested-rethrow.m +++ b/clang/test/CodeGenObjC/nested-rethrow.m @@ -3,7 +3,7 @@ extern int printf(const char*, ...); -int main() +int main(void) { @try { @throw @"foo"; diff --git a/clang/test/CodeGenObjC/no-sanitize.m b/clang/test/CodeGenObjC/no-sanitize.m index 07a196b..abaf6fa 100644 --- a/clang/test/CodeGenObjC/no-sanitize.m +++ b/clang/test/CodeGenObjC/no-sanitize.m @@ -4,6 +4,6 @@ @implementation I0 // CHECK-NOT: sanitize_address - (void) im0: (int) a0 __attribute__((no_sanitize("address"))) { - int (^blockName)() = ^int() { return 0; }; + int (^blockName)(void) = ^int(void) { return 0; }; } @end diff --git a/clang/test/CodeGenObjC/noescape.m b/clang/test/CodeGenObjC/noescape.m index e3a1160..3186ebc 100644 --- a/clang/test/CodeGenObjC/noescape.m +++ b/clang/test/CodeGenObjC/noescape.m @@ -135,7 +135,7 @@ void test6(id a, id b) { // CHECK-ARC-NOT: define internal void @__Block_byref_object_copy_ // CHECK-ARC-NOT: define internal void @__Block_byref_object_dispose_ -void test7() { +void test7(void) { id a; __block id b0; noescapeFunc0(a, ^{ (void)b0; }); @@ -161,7 +161,7 @@ struct S0 { id a, b; }; -void test8() { +void test8(void) { id a; __block struct S0 b0; noescapeFunc0(a, ^{ (void)b0; }); diff --git a/clang/test/CodeGenObjC/nontrivial-c-struct-within-struct-name.m b/clang/test/CodeGenObjC/nontrivial-c-struct-within-struct-name.m index dac8686..e67e674 100644 --- a/clang/test/CodeGenObjC/nontrivial-c-struct-within-struct-name.m +++ b/clang/test/CodeGenObjC/nontrivial-c-struct-within-struct-name.m @@ -14,9 +14,9 @@ typedef struct { Bar bar; } Baz; -I *getI(); +I *getI(void); -void f() { +void f(void) { Foo foo = {getI()}; Bar bar = {foo}; Baz baz = {bar}; diff --git a/clang/test/CodeGenObjC/ns-constant-strings.m b/clang/test/CodeGenObjC/ns-constant-strings.m index 4cbbb9a..236adff 100644 --- a/clang/test/CodeGenObjC/ns-constant-strings.m +++ b/clang/test/CodeGenObjC/ns-constant-strings.m @@ -24,7 +24,7 @@ extern struct objc_class _NSConstantStringClassReference; const NSConstantString *appKey = @"MyApp"; -int main() { +int main(void) { const NSConstantString *appKey = @"MyApp"; const NSConstantString *appKey1 = @"MyApp1"; } diff --git a/clang/test/CodeGenObjC/objc-alloc-init.m b/clang/test/CodeGenObjC/objc-alloc-init.m index 8370202..2ae6d00 100644 --- a/clang/test/CodeGenObjC/objc-alloc-init.m +++ b/clang/test/CodeGenObjC/objc-alloc-init.m @@ -8,7 +8,7 @@ -(X *)init; @end -void f() { +void f(void) { [[X alloc] init]; // OPTIMIZED: call i8* @objc_alloc_init( // NOT_OPTIMIZED: call i8* @objc_alloc( diff --git a/clang/test/CodeGenObjC/objc-arc-container-subscripting.m b/clang/test/CodeGenObjC/objc-arc-container-subscripting.m index 2f6062d..1e6d980 100644 --- a/clang/test/CodeGenObjC/objc-arc-container-subscripting.m +++ b/clang/test/CodeGenObjC/objc-arc-container-subscripting.m @@ -5,7 +5,7 @@ - (void)setObject:(id)object atIndexedSubscript:(int)index; @end -id func() { +id func(void) { NSMutableArray *array; array[3] = 0; return array[3]; diff --git a/clang/test/CodeGenObjC/objc-asm-attribute-test.m b/clang/test/CodeGenObjC/objc-asm-attribute-test.m index 51a8aa0..1771fbd 100644 --- a/clang/test/CodeGenObjC/objc-asm-attribute-test.m +++ b/clang/test/CodeGenObjC/objc-asm-attribute-test.m @@ -51,7 +51,7 @@ __attribute__((objc_runtime_name("foo"))) + (instancetype)alloc; @end -id Test16877359() { +id Test16877359(void) { return [SLREarth alloc]; } diff --git a/clang/test/CodeGenObjC/objc-assign-ivar.m b/clang/test/CodeGenObjC/objc-assign-ivar.m index 0dc9ec2..4589c8c 100644 --- a/clang/test/CodeGenObjC/objc-assign-ivar.m +++ b/clang/test/CodeGenObjC/objc-assign-ivar.m @@ -32,7 +32,7 @@ int IvarAssigns; void *rhs = 0; #define ASSIGNTEST(expr, global) expr = rhs -void testIvars() { +void testIvars(void) { Foo *foo; ASSIGNTEST(foo->ivar, IvarAssigns); // objc_assign_ivar ASSIGNTEST(foo->dict, IvarAssigns); // objc_assign_ivar diff --git a/clang/test/CodeGenObjC/objc-container-subscripting-1.m b/clang/test/CodeGenObjC/objc-container-subscripting-1.m index 7b198d4..c827bf1 100644 --- a/clang/test/CodeGenObjC/objc-container-subscripting-1.m +++ b/clang/test/CodeGenObjC/objc-container-subscripting-1.m @@ -13,7 +13,7 @@ typedef unsigned int size_t; - (void)setObject:(id)object forKeyedSubscript:(id)key; @end -int main() { +int main(void) { NSMutableArray *array; id val; diff --git a/clang/test/CodeGenObjC/objc-container-subscripting.m b/clang/test/CodeGenObjC/objc-container-subscripting.m index fd8f8ef..6ec8d9c 100644 --- a/clang/test/CodeGenObjC/objc-container-subscripting.m +++ b/clang/test/CodeGenObjC/objc-container-subscripting.m @@ -24,7 +24,7 @@ typedef unsigned int size_t; @class NSString; -int main() { +int main(void) { NSMutableArray

* array; id oldObject = array[10]; diff --git a/clang/test/CodeGenObjC/objc-dictionary-literal.m b/clang/test/CodeGenObjC/objc-dictionary-literal.m index b335582..5d505ae 100644 --- a/clang/test/CodeGenObjC/objc-dictionary-literal.m +++ b/clang/test/CodeGenObjC/objc-dictionary-literal.m @@ -17,7 +17,7 @@ typedef unsigned long NSUInteger; @interface NSString @end -int main() { +int main(void) { NSDictionary *dict = @{ @"name":@666 }; NSDictionary *dict1 = @{ @"name":@666 }; NSDictionary *dict2 = @{ @"name":@666 }; diff --git a/clang/test/CodeGenObjC/objc-fixed-enum.m b/clang/test/CodeGenObjC/objc-fixed-enum.m index 7555a8d..0c123ce 100644 --- a/clang/test/CodeGenObjC/objc-fixed-enum.m +++ b/clang/test/CodeGenObjC/objc-fixed-enum.m @@ -32,7 +32,7 @@ enum : NSInteger }; typedef NSInteger Enum3; -int main() { +int main(void) { Enum0 e0 = Enum0One; // CHECK: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[ENUM0:[0-9]+]], metadata !{{.*}}) Enum1 e1 = Enum1One; diff --git a/clang/test/CodeGenObjC/objc-literal-debugger-test.m b/clang/test/CodeGenObjC/objc-literal-debugger-test.m index d4043aa..300fd42 100644 --- a/clang/test/CodeGenObjC/objc-literal-debugger-test.m +++ b/clang/test/CodeGenObjC/objc-literal-debugger-test.m @@ -21,7 +21,7 @@ @end #endif -int main() { +int main(void) { // object literals. id l; l = @'a'; diff --git a/clang/test/CodeGenObjC/objc-literal-tests.m b/clang/test/CodeGenObjC/objc-literal-tests.m index 09561f9..71225ae 100644 --- a/clang/test/CodeGenObjC/objc-literal-tests.m +++ b/clang/test/CodeGenObjC/objc-literal-tests.m @@ -51,10 +51,10 @@ typedef signed char BOOL; @end #endif -id NSUserName(); +id NSUserName(void); // CHECK: define{{.*}} i32 @main() [[NUW:#[0-9]+]] -int main() { +int main(void) { // CHECK: call{{.*}}@objc_msgSend{{.*}}i8 noundef signext 97 NSNumber *aNumber = @'a'; // CHECK: call{{.*}}@objc_msgSend{{.*}}i32 noundef 42 diff --git a/clang/test/CodeGenObjC/objc-read-weak-byref.m b/clang/test/CodeGenObjC/objc-read-weak-byref.m index 228f477..057700d 100644 --- a/clang/test/CodeGenObjC/objc-read-weak-byref.m +++ b/clang/test/CodeGenObjC/objc-read-weak-byref.m @@ -7,7 +7,7 @@ - copy; @end -int main() { +int main(void) { NSObject *object = 0; __weak __block NSObject* weak_object = object; void (^callback) (void) = [^{ diff --git a/clang/test/CodeGenObjC/objc2-assign-global.m b/clang/test/CodeGenObjC/objc2-assign-global.m index 147aa3d..cec428d 100644 --- a/clang/test/CodeGenObjC/objc2-assign-global.m +++ b/clang/test/CodeGenObjC/objc2-assign-global.m @@ -35,7 +35,7 @@ struct_with_ids_t GlobalStructArray[10]; #define ASSIGNTEST(expr, global) expr = rhs void *rhs = 0; -int main() { +int main(void) { static id staticGlobalId; static id staticGlobalArray[20]; static NSObject *staticGlobalObject; diff --git a/clang/test/CodeGenObjC/objc2-new-gc-api-strongcast.m b/clang/test/CodeGenObjC/objc2-new-gc-api-strongcast.m index 5619ab3..de81ee0 100644 --- a/clang/test/CodeGenObjC/objc2-new-gc-api-strongcast.m +++ b/clang/test/CodeGenObjC/objc2-new-gc-api-strongcast.m @@ -14,7 +14,7 @@ void foo (int _nextId) typedef struct { unsigned long state; id *itemsPtr; - void (^bp)(); + void (^bp)(void); unsigned long *mutationsPtr; unsigned long extra[5]; } NSFastEnumerationState; diff --git a/clang/test/CodeGenObjC/objc2-strong-cast-block-import.m b/clang/test/CodeGenObjC/objc2-strong-cast-block-import.m index adec376..b30dcd8 100644 --- a/clang/test/CodeGenObjC/objc2-strong-cast-block-import.m +++ b/clang/test/CodeGenObjC/objc2-strong-cast-block-import.m @@ -7,7 +7,7 @@ } @end -id newObject(); +id newObject(void); void runWithBlock(void(^)(int i)); @implementation Test diff --git a/clang/test/CodeGenObjC/objc2-weak-assign.m b/clang/test/CodeGenObjC/objc2-weak-assign.m index 13ce338..6b529d7 100644 --- a/clang/test/CodeGenObjC/objc2-weak-assign.m +++ b/clang/test/CodeGenObjC/objc2-weak-assign.m @@ -15,7 +15,7 @@ void foo (__weak id *param) { *param = 0; } -int main() +int main(void) { *x = 0; *y = 0; diff --git a/clang/test/CodeGenObjC/objc2-weak-compare.m b/clang/test/CodeGenObjC/objc2-weak-compare.m index d8d5459..093a78a 100644 --- a/clang/test/CodeGenObjC/objc2-weak-compare.m +++ b/clang/test/CodeGenObjC/objc2-weak-compare.m @@ -11,7 +11,7 @@ PBXTarget * result; - Meth; @end -extern void foo(); +extern void foo(void); @implementation PBXTarget - Meth { if (_lastKnownTarget != result) diff --git a/clang/test/CodeGenObjC/objc2-weak-import-attribute.m b/clang/test/CodeGenObjC/objc2-weak-import-attribute.m index 6ee5746..5ed54f7 100644 --- a/clang/test/CodeGenObjC/objc2-weak-import-attribute.m +++ b/clang/test/CodeGenObjC/objc2-weak-import-attribute.m @@ -24,7 +24,7 @@ __attribute__((weak_import)) + message; @end -int main() { +int main(void) { [WeakClass3 message]; } diff --git a/clang/test/CodeGenObjC/objc2-write-barrier.m b/clang/test/CodeGenObjC/objc2-write-barrier.m index 7634dc9..b8d0ccb 100644 --- a/clang/test/CodeGenObjC/objc2-write-barrier.m +++ b/clang/test/CodeGenObjC/objc2-write-barrier.m @@ -56,7 +56,7 @@ void* rhs = 0; #define ASSIGNTEST(expr, global) expr = (typeof(expr))rhs -int testGlobals() { +int testGlobals(void) { // Everything in this function generates assign_global intercepts int counter = 0; @@ -97,7 +97,7 @@ int testGlobals() { } -int testIvars() { +int testIvars(void) { Foo *foo; int counter = 0; diff --git a/clang/test/CodeGenObjC/object-incr-decr-1.m b/clang/test/CodeGenObjC/object-incr-decr-1.m index c1181a21..611ca05 100644 --- a/clang/test/CodeGenObjC/object-incr-decr-1.m +++ b/clang/test/CodeGenObjC/object-incr-decr-1.m @@ -6,7 +6,7 @@ } @end -Foo* foo() +Foo* foo(void) { Foo *f; diff --git a/clang/test/CodeGenObjC/os_log.m b/clang/test/CodeGenObjC/os_log.m index 8a67694..d261c71 100644 --- a/clang/test/CodeGenObjC/os_log.m +++ b/clang/test/CodeGenObjC/os_log.m @@ -16,7 +16,7 @@ C *c; @class NSString; -extern __attribute__((visibility("default"))) NSString *GenString(); +extern __attribute__((visibility("default"))) NSString *GenString(void); void os_log_pack_send(void *); // CHECK-LABEL: define{{.*}} void @test_builtin_os_log1( @@ -26,8 +26,8 @@ void os_log_pack_send(void *); // CHECK-O2: %[[V0:.*]] = call i8* @llvm.objc.retain( // CHECK-O2: store i8* %[[V0]], i8** %[[A_ADDR]], align 8, // CHECK-O0: call void @llvm.objc.storeStrong(i8** %[[A_ADDR]], i8* %{{.*}}) -// CHECK-O2: %[[V4:.*]] = call %{{.*}}* (...) @GenString() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ] -// CHECK-O0: %[[CALL:.*]] = call %{{.*}}* (...) @GenString() +// CHECK-O2: %[[V4:.*]] = call %{{.*}}* @GenString() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ] +// CHECK-O0: %[[CALL:.*]] = call %{{.*}}* @GenString() // CHECK-O0: %[[V2:.*]] = bitcast %{{.*}}* %[[CALL]] to i8* // CHECK-O0: %[[V3:.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %[[V2]]) // CHECK-O0: %[[V4:.*]] = bitcast i8* %[[V3]] to %{{.*}}* @@ -72,8 +72,8 @@ void test_builtin_os_log2(void *buf, id __unsafe_unretained a) { // CHECK-LABEL: define{{.*}} void @test_builtin_os_log3( // CHECK: alloca i8*, align 8 // CHECK: %[[OS_LOG_ARG:.*]] = alloca i8*, align 8 -// CHECK-O2: %[[V3:.*]] = call %{{.*}}* (...) @GenString() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ] -// CHECK-O0: %[[CALL:.*]] = call %{{.*}}* (...) @GenString() +// CHECK-O2: %[[V3:.*]] = call %{{.*}}* @GenString() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ] +// CHECK-O0: %[[CALL:.*]] = call %{{.*}}* @GenString() // CHECK-O0: %[[V1:.*]] = bitcast %{{.*}}* %[[CALL]] to i8* // CHECK-O0: %[[V2:.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %[[V1]]) // CHECK-O0: %[[V3:.*]] = bitcast i8* %[[V2]] to %{{.*}}* diff --git a/clang/test/CodeGenObjC/property-agrr-getter.m b/clang/test/CodeGenObjC/property-agrr-getter.m index 6d8f1d6..7a1b06d 100644 --- a/clang/test/CodeGenObjC/property-agrr-getter.m +++ b/clang/test/CodeGenObjC/property-agrr-getter.m @@ -31,7 +31,7 @@ typedef struct _NSSize { @end -float f () +float f (void) { AnObject* obj; return (obj.size).width; diff --git a/clang/test/CodeGenObjC/property-getter-dot-syntax.m b/clang/test/CodeGenObjC/property-getter-dot-syntax.m index f22b051..d5875a3 100644 --- a/clang/test/CodeGenObjC/property-getter-dot-syntax.m +++ b/clang/test/CodeGenObjC/property-getter-dot-syntax.m @@ -4,7 +4,7 @@ - (void *)description; @end -int main() +int main(void) { id eggs; void *eggsText= eggs.description; diff --git a/clang/test/CodeGenObjC/property-incr-decr-1.m b/clang/test/CodeGenObjC/property-incr-decr-1.m index d75c02e..99535cd 100644 --- a/clang/test/CodeGenObjC/property-incr-decr-1.m +++ b/clang/test/CodeGenObjC/property-incr-decr-1.m @@ -15,7 +15,7 @@ @synthesize myValue=_myValue; @end -int main() +int main(void) { int val; SomeClass *o = [SomeClass new]; diff --git a/clang/test/CodeGenObjC/property-ref-cast-to-void.m b/clang/test/CodeGenObjC/property-ref-cast-to-void.m index 6f24d62..5be6a60 100644 --- a/clang/test/CodeGenObjC/property-ref-cast-to-void.m +++ b/clang/test/CodeGenObjC/property-ref-cast-to-void.m @@ -8,7 +8,7 @@ - (double)myGetter; @end -void FUNC () { +void FUNC (void) { TestClass *obj; (void)obj.myProperty; (void)obj.myGetter; diff --git a/clang/test/CodeGenObjC/property.m b/clang/test/CodeGenObjC/property.m index dae9111..aca3fe2 100644 --- a/clang/test/CodeGenObjC/property.m +++ b/clang/test/CodeGenObjC/property.m @@ -56,7 +56,7 @@ int printf(const char *, ...); // Test that compound operations only compute the base once. // CHECK-LABEL: define{{.*}} void @test2 A *test2_helper(void); -void test2() { +void test2(void) { // CHECK: [[BASE:%.*]] = call [[A:%.*]]* @test2_helper() // CHECK-NEXT: [[BASETMP:%.*]] = bitcast [[A]]* [[BASE]] to i8* // CHECK-NEXT: [[SEL:%.*]] = load i8*, i8** diff --git a/clang/test/CodeGenObjC/protocols-lazy.m b/clang/test/CodeGenObjC/protocols-lazy.m index a2dfc10..6764d04 100644 --- a/clang/test/CodeGenObjC/protocols-lazy.m +++ b/clang/test/CodeGenObjC/protocols-lazy.m @@ -12,7 +12,7 @@ // RUN: grep OBJC_PROTOCOL_P2 %t | count 3 // RUN: grep OBJC_PROTOCOL_INSTANCE_METHODS_P2 %t | count 3 @protocol P2 -im1; @end -void f0() { id x = @protocol(P2); } +void f0(void) { id x = @protocol(P2); } // Forward definition triggered by protocol reference. // RUN: grep OBJC_PROTOCOL_P3 %t | count 3 @@ -51,5 +51,5 @@ void f0() { id x = @protocol(P2); } @protocol P6 -im1; @end @interface I1 @end @implementation I1 -im1 { return 0; }; @end -void f3() { id x = @protocol(P6); } +void f3(void) { id x = @protocol(P6); } diff --git a/clang/test/CodeGenObjC/protocols.m b/clang/test/CodeGenObjC/protocols.m index 9f8abd4..354bb0f 100644 --- a/clang/test/CodeGenObjC/protocols.m +++ b/clang/test/CodeGenObjC/protocols.m @@ -49,7 +49,7 @@ void foo(const id a) { void *p = @protocol(P3); } -int main() { +int main(void) { Protocol *P0 = @protocol(P0); Protocol *P1 = @protocol(P1); Protocol *P2 = @protocol(P2); @@ -68,6 +68,6 @@ int main() { // rdar://problem/7992749 typedef Root P1Object; -int test10() { +int test10(void) { return [P1Object maxValue]; } diff --git a/clang/test/CodeGenObjC/related-result-type.m b/clang/test/CodeGenObjC/related-result-type.m index cacf2c0..fea31bf 100644 --- a/clang/test/CodeGenObjC/related-result-type.m +++ b/clang/test/CodeGenObjC/related-result-type.m @@ -10,7 +10,7 @@ @end // CHECK-LABEL: define {{.*}}void @test1() -void test1() { +void test1(void) { // CHECK: {{call.*@objc_msgSend}} // CHECK: {{call.*@objc_msgSend}} // CHECK: {{call.*@objc_msgSend}} @@ -19,7 +19,7 @@ void test1() { } // CHECK-LABEL: define {{.*}}void @test2() -void test2() { +void test2(void) { // CHECK: {{call.*@objc_msgSend}} // CHECK: {{call.*@objc_msgSend}} // CHECK: {{call.*@objc_msgSend}} diff --git a/clang/test/CodeGenObjC/stret.m b/clang/test/CodeGenObjC/stret.m index beb6f30..03aac40 100644 --- a/clang/test/CodeGenObjC/stret.m +++ b/clang/test/CodeGenObjC/stret.m @@ -17,6 +17,6 @@ struct st { int i[1000]; }; @interface Test +(struct st)method; @end -int main() { +int main(void) { [Test method]; } diff --git a/clang/test/CodeGenObjC/strong-in-c-struct.m b/clang/test/CodeGenObjC/strong-in-c-struct.m index c5eae31..4a41287 100644 --- a/clang/test/CodeGenObjC/strong-in-c-struct.m +++ b/clang/test/CodeGenObjC/strong-in-c-struct.m @@ -601,7 +601,7 @@ void test_copy_constructor_StrongVolatile1(Strong *s) { void test_block_capture_Strong(void) { Strong t; - BlockTy b = ^(){ (void)t; }; + BlockTy b = ^(void){ (void)t; }; } // CHECK: define{{.*}} void @test_variable_length_array(i32 noundef %[[N:.*]]) @@ -920,7 +920,7 @@ struct ZeroBitfield { // CHECK: define linkonce_odr hidden void @__default_constructor_8_sv0 // CHECK: define linkonce_odr hidden void @__copy_assignment_8_8_sv0 -void test_zero_bitfield() { +void test_zero_bitfield(void) { struct ZeroBitfield volatile a, b; a = b; } diff --git a/clang/test/CodeGenObjC/super-dotsyntax-property.m b/clang/test/CodeGenObjC/super-dotsyntax-property.m index 9dfde2d..a7da21c 100644 --- a/clang/test/CodeGenObjC/super-dotsyntax-property.m +++ b/clang/test/CodeGenObjC/super-dotsyntax-property.m @@ -35,7 +35,7 @@ } @end -void f0() { +void f0(void) { int l1 = A.classGetter; int l2 = [A classGetter2]; } diff --git a/clang/test/CodeGenObjC/tentative-cfconstantstring.m b/clang/test/CodeGenObjC/tentative-cfconstantstring.m index d5cd259..9a3a6c2 100644 --- a/clang/test/CodeGenObjC/tentative-cfconstantstring.m +++ b/clang/test/CodeGenObjC/tentative-cfconstantstring.m @@ -15,7 +15,7 @@ int __CFConstantStringClassReference[24]; @end -static inline void _inlineFunction() { +static inline void _inlineFunction(void) { [Bar format:@" "]; } diff --git a/clang/test/CodeGenObjC/ubsan-bool.m b/clang/test/CodeGenObjC/ubsan-bool.m index 0490100..7e69e09 100644 --- a/clang/test/CodeGenObjC/ubsan-bool.m +++ b/clang/test/CodeGenObjC/ubsan-bool.m @@ -5,7 +5,7 @@ typedef signed char BOOL; // SHARED-LABEL: f1 -BOOL f1() { +BOOL f1(void) { // OBJC: call void @__ubsan_handle_load_invalid_value // C-NOT: call void @__ubsan_handle_load_invalid_value BOOL a = 2; diff --git a/clang/test/CodeGenObjC/ubsan-nonnull-and-nullability.m b/clang/test/CodeGenObjC/ubsan-nonnull-and-nullability.m index 41f7c76..d9d16e5 100644 --- a/clang/test/CodeGenObjC/ubsan-nonnull-and-nullability.m +++ b/clang/test/CodeGenObjC/ubsan-nonnull-and-nullability.m @@ -34,7 +34,7 @@ __attribute__((returns_nonnull)) int *_Nonnull f1(int *_Nonnull p) { void f2(int *_Nonnull __attribute__((nonnull)) p) {} // CHECK-LABEL: define{{.*}} void @call_f2 -void call_f2() { +void call_f2(void) { // CHECK: call void @__ubsan_handle_nonnull_arg_abort // CHECK-NOT: call void @__ubsan_handle_nonnull_arg_abort f2((void *)0); @@ -52,7 +52,7 @@ int *f3(int *p) { // statement, to avoid accidentally calling the runtime. // CHECK-LABEL: define{{.*}} nonnull i32* @f4 -__attribute__((returns_nonnull)) int *f4() { +__attribute__((returns_nonnull)) int *f4(void) { // CHECK: store i8* null, i8** [[SLOC_PTR:%.*]] // CHECK: [[SLOC:%.*]] = load {{.*}} [[SLOC_PTR]] // CHECK: [[SLOC_NONNULL:%.*]] = icmp ne i8* [[SLOC]], null diff --git a/clang/test/CodeGenObjC/ubsan-nullability.m b/clang/test/CodeGenObjC/ubsan-nullability.m index 7e714c9..22e5d59 100644 --- a/clang/test/CodeGenObjC/ubsan-nullability.m +++ b/clang/test/CodeGenObjC/ubsan-nullability.m @@ -186,7 +186,7 @@ void dont_crash(int *_Nonnull p, ...) {} #pragma clang assume_nonnull begin /// Create a "NSObject * _Nonnull" instance. -NSObject *get_nonnull_error() { +NSObject *get_nonnull_error(void) { // Use nil for convenience. The actual object doesn't matter. return (NSObject *)NULL; } @@ -194,7 +194,7 @@ NSObject *get_nonnull_error() { NSObject *_Nullable no_null_return_value_diagnostic(int flag) { // CHECK-LABEL: define internal {{.*}}no_null_return_value_diagnostic{{i?}}_block_invoke // CHECK-NOT: @__ubsan_handle_nullability_return - NSObject *_Nullable (^foo)() = ^() { + NSObject *_Nullable (^foo)(void) = ^(void) { if (flag) { // Clang should not infer a nonnull return value for this block when this // call is present. @@ -208,7 +208,7 @@ NSObject *_Nullable no_null_return_value_diagnostic(int flag) { #pragma clang assume_nonnull end -int main() { +int main(void) { nonnull_retval1(INULL); nonnull_retval2(INNULL, INNULL, INULL, (int *_Nullable)NULL, 0, 0, 0, 0); call_func_with_nonnull_arg(INNULL); diff --git a/clang/test/CodeGenObjC/unqual-copy-restore.m b/clang/test/CodeGenObjC/unqual-copy-restore.m index 09915f7..0dc6bcb 100644 --- a/clang/test/CodeGenObjC/unqual-copy-restore.m +++ b/clang/test/CodeGenObjC/unqual-copy-restore.m @@ -7,7 +7,7 @@ typedef int handler(id *const p); -int main() { +int main(void) { id i1 = 0; handler *func = 0; return func(&i1); diff --git a/clang/test/CodeGenObjC/weak-metaclass-visibility.m b/clang/test/CodeGenObjC/weak-metaclass-visibility.m index 9254ede..998a8a5 100644 --- a/clang/test/CodeGenObjC/weak-metaclass-visibility.m +++ b/clang/test/CodeGenObjC/weak-metaclass-visibility.m @@ -24,7 +24,7 @@ __attribute__((availability(macosx,introduced=9876.5))) } @end -void kit() +void kit(void) { MyClass *wrapper = [MyClass alloc]; } -- 2.7.4