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 seventh batch of tests being updated (there are a
significant number of other tests left to be updated).
This commit is contained in:
Aaron Ballman 2022-02-10 16:04:13 -05:00
parent bb362d890f
commit e9e55acd1b
114 changed files with 445 additions and 445 deletions

View File

@ -1 +1 @@
extern int foo();
extern int foo(void);

View File

@ -1,2 +1,2 @@
@import B;
int foo();
int foo(void);

View File

@ -1,7 +1,7 @@
#ifdef WANT_FOO
int* foo();
int* foo(void);
#endif
#ifdef WANT_BAR
char *bar();
char *bar(void);
#endif

View File

@ -3,4 +3,4 @@
#include "X.h"
int foo();
int foo(void);

View File

@ -1,4 +1,4 @@
#include <A/APriv.h>
#include "APriv2.h"
#include <Z/Z.h>
int foo();
int foo(void);

View File

@ -1,3 +1,3 @@
@import cstd.stdio;
@import other_constants.dbl_max;
static inline void SPXTrace() { fprintf(__stderrp, ""); }
static inline void SPXTrace(void) { fprintf(__stderrp, ""); }

View File

@ -1 +1 @@
const char *getSubdir();
const char *getSubdir(void);

View File

@ -1 +1 @@
void f() {}
void f(void) {}

View File

@ -11,5 +11,5 @@
#import <A/A.h>
int bar() { return foo(); }
int bar(void) { return foo(); }

View File

@ -24,9 +24,9 @@ Module *mod; // expected-error{{declaration of 'Module' must be imported from mo
#endif
Module *mod2;
int getDependsOther() { return depends_on_module_other; }
int getDependsOther(void) { return depends_on_module_other; }
void testSubframeworkOther() {
void testSubframeworkOther(void) {
#ifdef ERRORS
double *sfo1 = sub_framework_other; // expected-error{{declaration of 'sub_framework_other' must be imported from module 'DependsOnModule.SubFramework.Other'}}
// expected-note@Inputs/DependsOnModule.framework/Frameworks/SubFramework.framework/Headers/Other.h:15 {{not visible}}
@ -35,44 +35,44 @@ void testSubframeworkOther() {
// Test umbrella-less submodule includes
#include <NoUmbrella/A.h> // expected-warning{{treating #include as an import of module 'NoUmbrella.A'}}
int getNoUmbrellaA() { return no_umbrella_A; }
int getNoUmbrellaA(void) { return no_umbrella_A; }
// Test umbrella-less submodule includes
#include <NoUmbrella/SubDir/C.h> // expected-warning{{treating #include as an import of module 'NoUmbrella.SubDir.C'}}
int getNoUmbrellaC() { return no_umbrella_C; }
int getNoUmbrellaC(void) { return no_umbrella_C; }
#ifndef ERRORS
// Test header cross-subframework include pattern.
#include <DependsOnModule/../Frameworks/SubFramework.framework/Headers/Other.h> // expected-warning{{treating #include as an import of module 'DependsOnModule.SubFramework.Other'}}
#endif
void testSubframeworkOtherAgain() {
void testSubframeworkOtherAgain(void) {
double *sfo1 = sub_framework_other;
}
void testModuleSubFramework() {
void testModuleSubFramework(void) {
char *msf = module_subframework;
}
#include <Module/../Frameworks/SubFramework.framework/Headers/SubFramework.h> // expected-warning{{treating #include as an import of module 'Module.SubFramework'}}
void testModuleSubFrameworkAgain() {
void testModuleSubFrameworkAgain(void) {
char *msf = module_subframework;
}
// Test inclusion of private headers.
#include <DependsOnModule/DependsOnModulePrivate.h> // expected-warning{{treating #include as an import of module 'DependsOnModule.Private.DependsOnModule'}}
int getDependsOnModulePrivate() { return depends_on_module_private; }
int getDependsOnModulePrivate(void) { return depends_on_module_private; }
#include <Module/ModulePrivate.h> // includes the header
int getModulePrivate() { return module_private; }
int getModulePrivate(void) { return module_private; }
#include <NoUmbrella/A_Private.h> // expected-warning{{treating #include as an import of module 'NoUmbrella.Private.A_Private'}}
int getNoUmbrellaAPrivate() { return no_umbrella_A_private; }
int getNoUmbrellaAPrivate(void) { return no_umbrella_A_private; }
int getNoUmbrellaBPrivateFail() { return no_umbrella_B_private; } // expected-error{{declaration of 'no_umbrella_B_private' must be imported from module 'NoUmbrella.Private.B_Private'}}
int getNoUmbrellaBPrivateFail(void) { return no_umbrella_B_private; } // expected-error{{declaration of 'no_umbrella_B_private' must be imported from module 'NoUmbrella.Private.B_Private'}}
// expected-note@Inputs/NoUmbrella.framework/PrivateHeaders/B_Private.h:1 {{not visible}}
// Test inclusion of headers that are under an umbrella directory but
@ -80,11 +80,11 @@ int getNoUmbrellaBPrivateFail() { return no_umbrella_B_private; } // expected-er
#include <Module/NotInModule.h> // expected-warning{{treating #include as an import of module 'Module.NotInModule'}} \
// expected-warning{{missing submodule 'Module.NotInModule'}}
int getNotInModule() {
int getNotInModule(void) {
return not_in_module;
}
void includeNotAtTopLevel() { // expected-note {{function 'includeNotAtTopLevel' begins here}}
void includeNotAtTopLevel(void) { // expected-note {{function 'includeNotAtTopLevel' begins here}}
#include <NoUmbrella/A.h> // expected-warning {{treating #include as an import}} \
expected-error {{redundant #include of module 'NoUmbrella.A' appears within function 'includeNotAtTopLevel'}}
}

View File

@ -6,32 +6,32 @@
@import autolink.sub2;
int f() {
int f(void) {
return autolink_sub2();
}
@import autolink;
int g() {
int g(void) {
return autolink;
}
@import Module.SubFramework;
const char *get_module_subframework() {
const char *get_module_subframework(void) {
return module_subframework;
}
@import DependsOnModule.SubFramework;
float *get_module_subframework_dep() {
float *get_module_subframework_dep(void) {
return sub_framework;
}
@import NoUmbrella;
int use_no_umbrella() {
int use_no_umbrella(void) {
return no_umbrella_A;
}
int use_autolink_sub3() {
int use_autolink_sub3(void) {
return autolink_sub3();
}

View File

@ -5,7 +5,7 @@
@import AutolinkTBD;
int f() {
int f(void) {
return foo();
}

View File

@ -17,17 +17,17 @@ void use_constant_string_builtins1(void) {
#include "builtin.h"
int foo() {
int foo(void) {
return __builtin_object_size(p, 0);
}
#include "builtin_sub.h"
int bar() {
int bar(void) {
return __builtin_object_size(p, 0);
}
int baz() {
int baz(void) {
return IS_CONST(0);
}

View File

@ -1,10 +1,10 @@
@import config;
int *test_foo() {
int *test_foo(void) {
return foo();
}
char *test_bar() {
char *test_bar(void) {
return bar(); // expected-warning{{implicit declaration of function 'bar' is invalid in C99}} \
// expected-warning{{incompatible integer to pointer conversion}}
}

View File

@ -7,7 +7,7 @@ const double other_value = DBL_MAX;
// Supplied by compiler, but referenced from the "/usr/include" module map.
@import cstd.float_constants;
float getFltMax() { return FLT_MAX; }
float getFltMax(void) { return FLT_MAX; }
// Supplied by the "/usr/include" module map.
@import cstd.stdio;

View File

@ -30,10 +30,10 @@ void testA(A *a) {
#endif
}
void testB() {
void testB(void) {
B b; // Note: redundant error silenced
}
void testDef() {
void testDef(void) {
[def defMethod];
}

View File

@ -4,7 +4,7 @@
// RUN: -fimplicit-module-maps -verify %s
@import NCI;
void foo() {
void foo(void) {
XYZLogEvent(xyzRiskyCloseOpenParam, xyzRiskyCloseOpenParam); // expected-error {{implicit declaration of function 'XYZLogEvent'}} expected-error {{declaration of 'XYZLogEvent' must be imported}} expected-error {{declaration of 'xyzRiskyCloseOpenParam' must be imported from module 'NCI.A'}} expected-error {{declaration of 'xyzRiskyCloseOpenParam' must be imported from module 'NCI.A'}}
}

View File

@ -42,7 +42,7 @@
// Make sure we correctly handle paths that resemble frameworks, but aren't.
#import "NotAFramework/Headers/Headers/Thing1.h"
int bar() { return foo(); }
int bar(void) { return foo(); }
// expected-warning@Inputs/double-quotes/A.framework/Headers/A.h:1{{double-quoted include "A0.h" in framework header, expected angle-bracketed instead}}
// expected-warning@Inputs/double-quotes/A.framework/Headers/A.h:2{{double-quoted include "B.h" in framework header, expected angle-bracketed instead}}

View File

@ -62,7 +62,7 @@ using namespace M;
#ifdef __cplusplus
namespace N {
#endif
void g() {
void g(void) {
int k = f();
}

View File

@ -28,7 +28,7 @@
#import "A.h"
int bar() { return foo(); }
int bar(void) { return foo(); }
// expected-warning@Inputs/framework-public-includes-private/A.framework/Headers/A.h:1{{public framework header includes private framework header 'A/APriv.h'}}
// expected-warning@Inputs/framework-public-includes-private/A.framework/Headers/A.h:2{{public framework header includes private framework header 'A/APriv2.h'}}

View File

@ -14,6 +14,6 @@
// CHECK: *** Global Module Index Statistics:
int *get_sub() {
int *get_sub(void) {
return Module_Sub;
}

View File

@ -5,7 +5,7 @@
@import import_decl;
// CHECK: struct T
int main() {
int main(void) {
return 0;
}

View File

@ -8,4 +8,4 @@
#include "a.h"
int f() { return n; }
int f(void) { return n; }

View File

@ -4,13 +4,13 @@
@import Module.Sub;
void test_Module_Sub() {
void test_Module_Sub(void) {
int *ip = Module_Sub;
}
@import Module.Buried.Treasure;
void dig() {
void dig(void) {
unsigned *up = Buried_Treasure;
}

View File

@ -43,7 +43,7 @@ DOUBLE *dp = &d;
#__public_macro WIBBLE // expected-error{{no macro named 'WIBBLE'}}
void f() {
void f(void) {
// CHECK-PREPROCESSED: int i = INTEGER;
int i = INTEGER; // the value was exported, the macro was not.
i += macros; // expanded from __MODULE__ within the 'macros' module.
@ -95,7 +95,7 @@ INTEGER my_integer = 0;
# error TOP_LEFT_UNDEF should not be defined
#endif
void test1() {
void test1(void) {
int i;
TOP_RIGHT_REDEF *ip = &i;
}
@ -120,7 +120,7 @@ void test1() {
# error TOP should be visible
#endif
void test2() {
void test2(void) {
int i;
float f;
double d;
@ -134,7 +134,7 @@ void test2() {
#define LEFT_RIGHT_DIFFERENT double // FIXME: expected-warning{{'LEFT_RIGHT_DIFFERENT' macro redefined}}
void test3() {
void test3(void) {
double d;
LEFT_RIGHT_DIFFERENT *dp = &d; // okay
int x = FN_ADD(1,2);
@ -146,7 +146,7 @@ void test3() {
@import macros_bottom;
TOP_DEF_RIGHT_UNDEF *TDRUf() { return TDRUp; }
TOP_DEF_RIGHT_UNDEF *TDRUf(void) { return TDRUp; }
@import macros_right.undef;

View File

@ -26,7 +26,7 @@ TOP_OTHER_DEF_RIGHT_UNDEF *n0b; // expected-warning{{ambiguous expansion of macr
# error TOP_RIGHT_UNDEF should still be defined
#endif
void test() {
void test(void) {
float f;
TOP_RIGHT_REDEF *fp = &f; // ok, right's definition overrides top's definition
@ -81,6 +81,6 @@ int n3 = TOP_OTHER_DEF_RIGHT_UNDEF; // ok
int top_redef_in_submodules = TOP_REDEF_IN_SUBMODULES;
@import macros_top.c;
void test2() {
void test2(void) {
int TOP_REDEF_IN_SUBMODULES = top_redef_in_submodules;
}

View File

@ -3,6 +3,6 @@
// RUN: %clang_cc1 -fmodules -fmodule-map-file=%S/Inputs/merge-fn-prototype-tags/module.modulemap -fmodules-cache-path=%t -x c -I%S/Inputs/merge-fn-prototype-tags -verify %s
#include "c.h"
void mmalloc_attach() { struct stat sbuf; }
void mmalloc_attach(void) { struct stat sbuf; }
// expected-no-diagnostics

View File

@ -2,6 +2,6 @@
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs %s -verify
#include <Module/NotInModule.h> // expected-warning{{missing submodule 'Module.NotInModule'}}
int getNotInModule() {
int getNotInModule(void) {
return not_in_module;
}

View File

@ -10,7 +10,7 @@
// expected-no-diagnostics
void test() {
void test(void) {
(void)MyModuleVersion; // should be found by implicit import
}

View File

@ -9,4 +9,4 @@
#import <A/a.h>
#import <A/aprivate.h>
int foo() { return APRIVATE; }
int foo(void) { return APRIVATE; }

View File

@ -10,7 +10,7 @@
@import Both_F;
@import Inferred;
void test() {
void test(void) {
will_be_found1();
wont_be_found1(); // expected-warning{{implicit declaration of function 'wont_be_found1' is invalid in C99}}
will_be_found2();

View File

@ -5,6 +5,6 @@
// expected-no-diagnostics
int foo() {
int foo(void) {
return MyEnumCst;
}

View File

@ -2,7 +2,7 @@
// RUN: %clang_cc1 -x objective-c -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/normal-module-map %s -verify
#include "Umbrella/umbrella_sub.h"
int getUmbrella() {
int getUmbrella(void) {
return umbrella + umbrella_sub;
}
@ -12,17 +12,17 @@ int getUmbrella() {
#include "b1.h"
#include "nested/nested2.h"
int test() {
int test(void) {
return a1 + b1 + nested2;
}
@import nested_umbrella.a;
int testNestedUmbrellaA() {
int testNestedUmbrellaA(void) {
return nested_umbrella_a;
}
int testNestedUmbrellaBFail() {
int testNestedUmbrellaBFail(void) {
return nested_umbrella_b;
// expected-error@-1{{declaration of 'nested_umbrella_b' must be imported from module 'nested_umbrella.b' before it is required}}
// expected-note@Inputs/normal-module-map/nested_umbrella/b.h:1{{here}}
@ -30,7 +30,7 @@ int testNestedUmbrellaBFail() {
@import nested_umbrella.b;
int testNestedUmbrellaB() {
int testNestedUmbrellaB(void) {
return nested_umbrella_b;
}
@ -40,6 +40,6 @@ int testNestedUmbrellaB() {
@import nested_umbrella.decltype_;
int testSanitizedName() {
int testSanitizedName(void) {
return extra_a + one + decltype_val;
}

View File

@ -11,6 +11,6 @@
#endif
void test2(const NSString*);
void test() {
void test(void) {
test2(kSimDeviceIOGetInterface);
}

View File

@ -8,7 +8,7 @@
@end
// expected-note@Inputs/Module.framework/Headers/Module.h:17{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
void test_getModuleVersion() {
void test_getModuleVersion(void) {
const char *version = getModuleVersion();
const char *version2 = [Module version];
@ -21,4 +21,4 @@ void test_getModuleVersion() {
@import subdir;
const char *getSubdirTest() { return getSubdir(); }
const char *getSubdirTest(void) { return getSubdir(); }

View File

@ -5,7 +5,7 @@
@import CmdLine;
void test() {
void test(void) {
#ifdef FOO_RETURNS_INT_PTR
int *ip = foo();
#else

View File

@ -4,7 +4,7 @@
// RUN: %clang_cc1 -x objective-c-header -emit-pch %S/Inputs/pch-used.h -o %t/pch-used.h.pch -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include
// RUN: %clang_cc1 %s -include-pch %t/pch-used.h.pch -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/cache -O0 -isystem %S/Inputs/System/usr/include -emit-llvm -o - | FileCheck %s
void f() { SPXTrace(); }
void g() { double x = DBL_MAX; }
void f(void) { SPXTrace(); }
void g(void) { double x = DBL_MAX; }
// CHECK: define internal {{.*}}void @SPXTrace

View File

@ -30,6 +30,6 @@
// expected-no-diagnostics
@import module_a;
int test() {
int test(void) {
return a;
}

View File

@ -5,6 +5,6 @@
// expected-no-diagnostics
@import prebuilt;
int test() {
int test(void) {
return a;
}

View File

@ -41,7 +41,7 @@ void f(A *a) {
@class A;
B *f1() {
B *f1(void) {
return [B create_a_B];
}
@ -60,7 +60,7 @@ struct S3 {
int s3_field;
};
void testTagMerge() {
void testTagMerge(void) {
consume_S1(produce_S1());
struct S2 s2;
s2.field = 0;
@ -105,7 +105,7 @@ void testVarMerge(int i) {
// Test redeclarations of entities in explicit submodules, to make
// sure we're maintaining the declaration chains even when normal name
// lookup can't see what we're looking for.
void testExplicit() {
void testExplicit(void) {
Explicit *e;
int *(*fp)(void) = &explicit_func;
int *ip = explicit_func();
@ -148,7 +148,7 @@ void test_ClassWithDef(ClassWithDef *cwd) {
@import redecl_merge_bottom;
void test_C4b() {
void test_C4b(void) {
if (&refers_to_C4) {
}
}

View File

@ -1,6 +1,6 @@
@import NewName;
int f() { return same_api; }
int f(void) { return same_api; }
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I %S/Inputs/oldname -fmodules-cache-path=%t %s -verify

View File

@ -1,6 +1,6 @@
@import StdDef.Other;
size_t getSize();
size_t getSize(void);
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/StdDef %s -verify

View File

@ -6,7 +6,7 @@
@import ModuleInSubdir;
void foo() {
void foo(void) {
int x = bar();
}

View File

@ -4,14 +4,14 @@
@import DependsOnModule;
void testSubFramework() {
void testSubFramework(void) {
float *sf1 = sub_framework; // expected-error{{declaration of 'sub_framework' must be imported from module 'DependsOnModule.SubFramework' before it is required}}
// expected-note@Inputs/DependsOnModule.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h:2 {{here}}
}
@import DependsOnModule.SubFramework;
void testSubFrameworkAgain() {
void testSubFrameworkAgain(void) {
float *sf2 = sub_framework;
double *sfo1 = sub_framework_other;
}

View File

@ -6,7 +6,7 @@
// Note: transitively imports Module.Sub2.
@import Module.Sub;
int getValue() {
int getValue(void) {
return *Module_Sub + *Module_Sub2;
}

View File

@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x objective-c-header %S/Inputs/typo.h -emit-pch -o %t.pch
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -include-pch %t.pch %s -verify
void test() {
void test(void) {
[Nsstring alloc]; // expected-error {{unknown receiver 'Nsstring'; did you mean 'NSString'}}
// expected-note@typo.h:* {{here}}
}

View File

@ -4,6 +4,6 @@
@import Test;
void foo() {
void foo(void) {
test_me_call();
}

View File

@ -2,13 +2,13 @@
// Do not crash ;)
void foo()
void foo(void)
{
#pragma omp critical
;
}
void bar()
void bar(void)
{
foo();
foo();

View File

@ -90,7 +90,7 @@ float2 float2x;
// register int rix __asm__("0");
register int rix __asm__("esp");
int main() {
int main(void) {
// CHECK: [[PREV:%.+]] = atomicrmw add i8* @{{.+}}, i8 1 monotonic, align 1
// CHECK: store i8 [[PREV]], i8* @{{.+}},
#pragma omp atomic capture

View File

@ -12,7 +12,7 @@ void xxx(int argc) {
argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
}
int foo() {
int foo(void) {
L1:
foo();
#pragma omp atomic
@ -39,7 +39,7 @@ struct S {
int a;
};
int readint() {
int readint(void) {
int a = 0, b = 0;
// Test for atomic read
#pragma omp atomic read
@ -67,7 +67,7 @@ int readint() {
return 0;
}
int readS() {
int readS(void) {
struct S a, b;
// expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'read' clause}} expected-error@+1 {{unexpected OpenMP clause 'allocate' in directive '#pragma omp atomic'}}
#pragma omp atomic read read allocate(a)
@ -78,7 +78,7 @@ int readS() {
return a.a;
}
int writeint() {
int writeint(void) {
int a = 0, b = 0;
// Test for atomic write
#pragma omp atomic write
@ -104,7 +104,7 @@ int writeint() {
return 0;
}
int writeS() {
int writeS(void) {
struct S a, b;
// expected-error@+1 {{directive '#pragma omp atomic' cannot contain more than one 'write' clause}}
#pragma omp atomic write write
@ -115,7 +115,7 @@ int writeS() {
return a.a;
}
int updateint() {
int updateint(void) {
int a = 0, b = 0;
// Test for atomic update
#pragma omp atomic update
@ -205,7 +205,7 @@ int updateint() {
return 0;
}
int captureint() {
int captureint(void) {
int a = 0, b = 0, c = 0;
// Test for atomic capture
#pragma omp atomic capture
@ -381,7 +381,7 @@ int captureint() {
return 0;
}
void hint() {
void hint(void) {
int a = 0;
#pragma omp atomic hint // omp45-error {{unexpected OpenMP clause 'hint' in directive '#pragma omp atomic'}} expected-error {{expected '(' after 'hint'}}
a += 1;
@ -398,10 +398,10 @@ void hint() {
}
#ifdef OMP51
extern void bbar();
extern int ffoo();
extern void bbar(void);
extern int ffoo(void);
void compare() {
void compare(void) {
int x = 0;
int d = 0;
int e = 0;

View File

@ -83,7 +83,7 @@ float2 float2x;
register int rix __asm__("esp");
// CHECK-LABEL: @main(
int main() {
int main(void) {
// CHECK: load atomic i8, i8* {{.*}} monotonic, align 1
// CHECK: store i8
#pragma omp atomic read

View File

@ -81,7 +81,7 @@ float2 float2x;
// register int rix __asm__("0");
register int rix __asm__("esp");
int main() {
int main(void) {
// CHECK-NOT: atomicrmw
#pragma omp atomic
++dv;

View File

@ -82,7 +82,7 @@ float2 float2x;
// register int rix __asm__("0");
register int rix __asm__("esp");
int main() {
int main(void) {
// CHECK: store atomic i32 1, i32* getelementptr inbounds ({ i32, i32 }, { i32, i32 }* @civ, i32 0, i32 1) monotonic, align 4
#pragma omp atomic write
__imag(civ) = 1;

View File

@ -28,6 +28,6 @@ int also_after(void) {
return 0;
}
int test() {
int test(void) {
return also_after() + also_before();
}

View File

@ -42,7 +42,7 @@ struct dat {
// CHECK: #pragma omp declare mapper (default : struct dat d) map(to: d.d){{$}}
// CHECK: int main() {
int main() {
int main(void) {
#pragma omp declare mapper(id: struct vec v) map(v.len)
// CHECK: #pragma omp declare mapper (id : struct vec v) map(tofrom: v.len)
{

View File

@ -32,7 +32,7 @@ void init(struct SSS *priv, struct SSS orig);
// CHECK: #pragma omp declare reduction (fun : struct SSS : omp_out = omp_in) initializer(init(&omp_priv, omp_orig))
// CHECK: int main() {
int main() {
int main(void) {
#pragma omp declare reduction(fun : struct SSS : omp_out = omp_in) initializer(init(&omp_priv, omp_orig))
// CHECK: #pragma omp declare reduction (fun : struct SSS : omp_out = omp_in) initializer(init(&omp_priv, omp_orig))
{

View File

@ -112,7 +112,7 @@ void init(struct SSS *priv, struct SSS orig);
// CHECK-LABEL: @main
// CHECK-LOAD-LABEL: @main
int main() {
int main(void) {
#pragma omp declare reduction(fun : struct SSS : omp_out = omp_in) initializer(init(&omp_priv, omp_orig))
// CHECK: define internal {{.*}}void @{{[^(]+}}([[SSS_INT]]* noalias noundef %0, [[SSS_INT]]* noalias noundef %1)
// CHECK: call void @llvm.memcpy
@ -170,7 +170,7 @@ int main() {
// CHECK-LABEL: bar
struct SSS ss;
int in;
void bar() {
void bar(void) {
// CHECK: [[SS_PRIV:%.+]] = alloca %struct.SSS,
// CHECK: [[IN_PRIV:%.+]] = alloca i32,
// CHECK: [[BC:%.+]] = bitcast %struct.SSS* [[SS_PRIV]] to i8*

View File

@ -3,8 +3,8 @@
#pragma omp begin declare variant match(device={arch(x86_64)})
void bar() {}
void bar(void) {}
// CHECK: FunctionDecl {{.*}} bar[device={arch(x86_64)}] 'void ()'
// CHECK: FunctionDecl {{.*}} bar[device={arch(x86_64)}] 'void (void)'
#pragma omp end declare variant

View File

@ -49,7 +49,7 @@ void t_vxv(int *v1, int *v2, int *v3, int n) {
// CK1-LABEL: define {{[^@]+}}@test
int test() {
int test(void) {
int v1[N], v2[N], v3[N];
// init
@ -222,7 +222,7 @@ int t_simd(int *v1, int *v2, int *v3, int idx) {
}
// CK3-LABEL: define {{[^@]+}}@test
void test() {
void test(void) {
int v1[N], v2[N], v3[N];
// init
@ -296,7 +296,7 @@ void all_vxv(int *v1, int *v2, int *v3, int n) {
#pragma omp end declare target
// CK4-LABEL: define {{[^@]+}}@test
void test() {
void test(void) {
int v1[N], v2[N], v3[N];
//init

View File

@ -55,7 +55,7 @@ int bar(void);
#pragma omp declare variant(foo) match(user = {condition(foo)}) // expected-error {{the user condition in the OpenMP context selector needs to be constant; foo is not}}
#pragma omp declare variant(foo) match(user = {condition(foo())}) // expected-error {{the user condition in the OpenMP context selector needs to be constant; foo() is not}}
#pragma omp declare variant(foo) match(user = {condition(<expr>)}) // expected-error {{expected expression}} expected-error {{use of undeclared identifier 'expr'}} expected-error {{expected expression}} expected-note {{the ignored selector spans until here}}
int score_and_cond_non_const();
int score_and_cond_non_const(void);
#pragma omp declare variant(foo) match(construct={teams,parallel,for,simd})
#pragma omp declare variant(foo) match(construct={target teams}) // expected-error {{expected ')'}} expected-warning {{expected '}' after the context selectors for the context set "construct"; '}' assumed}} expected-note {{to match this '('}} expected-error {{expected 'match' clause on 'omp declare variant' directive}}
@ -80,14 +80,14 @@ int var;
#pragma omp declare variant(foo) match(xxx={}) // expected-error {{function declaration is expected after 'declare variant' directive}}
#pragma omp declare variant(foo) match(xxx={}) // expected-error {{function declaration is expected after 'declare variant' directive}}
#pragma options align=packed
int main();
int main(void);
#pragma omp declare variant(foo) match(implementation={vendor(llvm)}) // expected-error {{function declaration is expected after 'declare variant' directive}}
#pragma omp declare variant(foo) match(implementation={vendor(llvm)}) // expected-error {{function declaration is expected after 'declare variant' directive}}
#pragma init_seg(compiler)
int main();
int main(void);
#pragma omp declare variant(foo) match(xxx={}) // expected-error {{single declaration is expected after 'declare variant' directive}} expected-warning {{'xxx' is not a valid context set in a `declare variant`; set ignored}} expected-note {{context set options are: 'construct' 'device' 'implementation' 'user'}} expected-note {{the ignored set spans until here}}
@ -108,8 +108,8 @@ int diff_proto(double); // expected-error {{conflicting types for 'diff_proto'}}
int diff_proto1(double);
int after_use_variant(void);
int after_use();
int bar() {
int after_use(void);
int bar(void) {
return after_use();
}
@ -150,7 +150,7 @@ int unknown_isa_trait2(void);
#pragma omp declare variant(foo) match(device = {kind(fpga), isa(bar)})
int ignored_isa_trait(void);
void caller() {
void caller(void) {
unknown_isa_trait(); // expected-warning {{isa trait 'foo' is not known to the current target; verify the spelling or consider restricting the context selector with the 'arch' selector further}}
unknown_isa_trait2(); // expected-warning {{isa trait 'foo' is not known to the current target; verify the spelling or consider restricting the context selector with the 'arch' selector further}}
ignored_isa_trait();

View File

@ -9,7 +9,7 @@ int y[100];
// CHECK-LABEL: @many_iterators_single_clause(
// CHECK: [[VLA:%.*]] = alloca [[STRUCT_KMP_DEPEND_INFO:%.*]], i64 10, align 16
// CHECK: = call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* {{.*}}, i32 {{.*}}, i8* {{.*}}, i32 10, i8* {{.*}}, i32 0, i8* null)
void many_iterators_single_clause() {
void many_iterators_single_clause(void) {
#pragma omp task depend(iterator(j=0:5), in: x[j], y[j])
{
}
@ -18,7 +18,7 @@ void many_iterators_single_clause() {
// CHECK-LABEL: @many_iterators_many_clauses(
// CHECK: [[VLA:%.*]] = alloca [[STRUCT_KMP_DEPEND_INFO:%.*]], i64 10, align 16
// CHECK: = call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* {{.*}}, i32 {{.*}}, i8* {{.*}}, i32 10, i8* {{.*}}, i32 0, i8* null)
void many_iterators_many_clauses() {
void many_iterators_many_clauses(void) {
#pragma omp task depend(iterator(j=0:5), in: x[j]) \
depend(iterator(j=0:5), in: y[j])
{

View File

@ -17,7 +17,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp distribute parallel for simd'}}
#pragma omp distribute parallel for simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp distribute parallel for simd
for (i = 0; i < 16; ++i)
@ -28,7 +28,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -57,7 +57,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp target
#pragma omp teams
@ -67,7 +67,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp target
@ -98,8 +98,8 @@ void test_non_identifiers() {
;
}
extern int foo();
void test_safelen() {
extern int foo(void);
void test_safelen(void) {
int i;
#pragma omp target
#pragma omp teams
@ -222,7 +222,7 @@ void test_safelen() {
;
}
void test_simdlen() {
void test_simdlen(void) {
int i;
#pragma omp target
#pragma omp teams
@ -345,7 +345,7 @@ void test_simdlen() {
;
}
void test_safelen_simdlen() {
void test_safelen_simdlen(void) {
int i;
#pragma omp target
#pragma omp teams
@ -362,7 +362,7 @@ void test_safelen_simdlen() {
;
}
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp target
#pragma omp teams
@ -498,7 +498,7 @@ void test_collapse() {
i += j;
}
void test_linear() {
void test_linear(void) {
int i;
#pragma omp target
#pragma omp teams
@ -561,7 +561,7 @@ void test_linear() {
;
}
void test_aligned() {
void test_aligned(void) {
int i;
#pragma omp target
#pragma omp teams
@ -699,7 +699,7 @@ void test_aligned() {
}
void test_private() {
void test_private(void) {
int i;
#pragma omp target
#pragma omp teams
@ -759,7 +759,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp target
#pragma omp teams
@ -819,7 +819,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp target
#pragma omp teams
@ -882,7 +882,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp target
#pragma omp teams
@ -900,7 +900,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp distribute parallel for simd nontemporal(

View File

@ -20,7 +20,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp distribute simd'}}
#pragma omp distribute simd safelen(4)
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target
#pragma omp teams
@ -35,7 +35,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -64,7 +64,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp target
#pragma omp teams
@ -74,7 +74,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp target
@ -99,8 +99,8 @@ void test_non_identifiers() {
;
}
extern int foo();
void test_safelen() {
extern int foo(void);
void test_safelen(void) {
int i;
#pragma omp target
#pragma omp teams
@ -224,7 +224,7 @@ void test_safelen() {
;
}
void test_simdlen() {
void test_simdlen(void) {
int i;
#pragma omp target
#pragma omp teams
@ -347,7 +347,7 @@ void test_simdlen() {
;
}
void test_safelen_simdlen() {
void test_safelen_simdlen(void) {
int i;
#pragma omp target
#pragma omp teams
@ -364,7 +364,7 @@ void test_safelen_simdlen() {
;
}
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp target
#pragma omp teams
@ -511,7 +511,7 @@ void test_collapse() {
i += j;
}
void test_linear() {
void test_linear(void) {
int i;
#pragma omp target
#pragma omp teams
@ -574,7 +574,7 @@ void test_linear() {
;
}
void test_aligned() {
void test_aligned(void) {
int i;
#pragma omp target
#pragma omp teams
@ -713,7 +713,7 @@ void test_aligned() {
;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp target
#pragma omp teams
@ -773,7 +773,7 @@ void test_private() {
}
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp target
#pragma omp teams
@ -784,7 +784,7 @@ void test_firstprivate() {
;
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp target
#pragma omp teams
@ -844,7 +844,7 @@ void test_lastprivate() {
;
}
void test_reduction() {
void test_reduction(void) {
int i, x, y;
#pragma omp target
#pragma omp teams
@ -992,7 +992,7 @@ void test_reduction() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp target
#pragma omp teams
@ -1034,7 +1034,7 @@ void linear_modifiers(int argc) {
for (k = 0; k < argc; ++k) ++k;
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp distribute simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp distribute simd nontemporal(

View File

@ -17,7 +17,7 @@
// RUN: %clang_cc1 -verify=ompx -fopenmp-simd \
// RUN: -fno-openmp-extensions -fopenmp-extensions %s
void foo() {
void foo(void) {
int x;
// ompx-no-diagnostics
// omp-error@+1 {{incorrect map type modifier}}

View File

@ -17,7 +17,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp for'}}
#pragma omp for foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp for
for (i = 0; i < 16; ++i)
@ -28,7 +28,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -56,7 +56,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp for' are ignored}}
@ -79,7 +79,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -106,9 +106,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -226,7 +226,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -277,7 +277,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -328,7 +328,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -379,7 +379,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}

View File

@ -17,7 +17,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp for simd'}}
#pragma omp for simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp for simd
for (i = 0; i < 16; ++i)
@ -28,7 +28,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -56,7 +56,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp for simd' are ignored}}
@ -65,7 +65,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -92,8 +92,8 @@ void test_non_identifiers() {
;
}
extern int foo();
void test_safelen() {
extern int foo(void);
void test_safelen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp for simd safelen
@ -178,7 +178,7 @@ void test_safelen() {
;
}
void test_simdlen() {
void test_simdlen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp for simd simdlen
@ -263,7 +263,7 @@ void test_simdlen() {
;
}
void test_safelen_simdlen() {
void test_safelen_simdlen(void) {
int i;
// expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
#pragma omp for simd simdlen(6) safelen(5)
@ -275,7 +275,7 @@ void test_safelen_simdlen() {
;
}
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -393,7 +393,7 @@ void test_collapse() {
i += j;
}
void test_linear() {
void test_linear(void) {
int i;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd linear(
@ -498,7 +498,7 @@ void test_linear() {
;
}
void test_aligned() {
void test_aligned(void) {
int i;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd aligned(
@ -596,7 +596,7 @@ void test_aligned() {
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -647,7 +647,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -698,7 +698,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -749,7 +749,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}
@ -765,7 +765,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp for simd nontemporal(

View File

@ -15,7 +15,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp master taskloop'}}
#pragma omp master taskloop foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp master taskloop
for (i = 0; i < 16; ++i)
@ -26,7 +26,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -54,7 +54,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
@ -67,7 +67,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -95,9 +95,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -205,7 +205,7 @@ void test_collapse() {
;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -256,7 +256,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -307,7 +307,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -358,7 +358,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}

View File

@ -17,7 +17,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp master taskloop simd'}}
#pragma omp master taskloop simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp master taskloop simd
for (i = 0; i < 16; ++i)
@ -28,7 +28,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -56,7 +56,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp master taskloop simd' are ignored}}
@ -69,7 +69,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -96,9 +96,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -206,7 +206,7 @@ void test_collapse() {
;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -257,7 +257,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -308,7 +308,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -363,7 +363,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}
@ -385,7 +385,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp master taskloop simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp master taskloop simd nontemporal(

View File

@ -5,9 +5,9 @@
#ifndef HEADER
#define HEADER
void bar();
void bar(void);
void foo() {
void foo(void) {
#pragma omp metadirective when(device = {kind(any)} \
: parallel)
bar();
@ -47,7 +47,7 @@ void foo() {
// CHECK: ret void
// CHECK: define internal void [[OUTLINED_1]](
// CHECK: call void {{.+}} @bar
// CHECK: call void @bar
// CHECK: ret void
// CHECK: define internal void [[OUTLINED_2]](
@ -61,15 +61,15 @@ void foo() {
// CHECK: ret void
// CHECK: define internal void [[OUTLINED_4]](
// CHECK: call void {{.+}} @bar
// CHECK: call void @bar
// CHECK: ret void
// CHECK: define internal void [[OUTLINED_5]](
// CHECK: call void {{.+}} @bar
// CHECK: call void @bar
// CHECK: ret void
// CHECK: define internal void [[OUTLINED_6]](
// CHECK: call void {{.+}} @bar
// CHECK: call void @bar
// CHECK: ret void
// CHECK: define internal void [[OUTLINED_7]](

View File

@ -6,9 +6,9 @@
#ifndef HEADER
#define HEADER
void bar();
void bar(void);
void foo() {
void foo(void) {
#pragma omp metadirective when(implementation = {vendor(score(0) \
: llvm)}, \
device = {kind(cpu)} \

View File

@ -9,7 +9,7 @@ extern int printf(const char *, ...);
// Check a simple call to printf end-to-end.
int CheckSimple() {
int CheckSimple(void) {
#pragma omp target
{
// printf in master-only basic block.
@ -21,7 +21,7 @@ int CheckSimple() {
return 0;
}
void CheckNoArgs() {
void CheckNoArgs(void) {
#pragma omp target
{
// printf in master-only basic block.
@ -32,7 +32,7 @@ void CheckNoArgs() {
// Check that printf's alloca happens in the entry block, not inside the if
// statement.
int foo;
void CheckAllocaIsInEntryBlock() {
void CheckAllocaIsInEntryBlock(void) {
#pragma omp target
{
if (foo) {

View File

@ -6,7 +6,7 @@
#pragma omp // expected-error {{expected an OpenMP directive}}
#pragma omp unknown_directive // expected-error {{expected an OpenMP directive}}
void foo() {
void foo(void) {
#pragma omp // expected-error {{expected an OpenMP directive}}
#pragma omp unknown_directive // expected-error {{expected an OpenMP directive}}
}

View File

@ -3,7 +3,7 @@
// RUN: %clang_cc1 -verify -fopenmp -x c -triple x86_64-unknown-linux-gnu -fopenmp-targets=aarch64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
// expected-no-diagnostics
void foo() {
void foo(void) {
#pragma omp target
{}
}

View File

@ -18,10 +18,10 @@
// CHECK: [[KMP_DIM:%.+]] = type { i64, i64, i64 }
extern int n;
int a[10], b[10], c[10], d[10];
void foo();
void foo(void);
// CHECK-LABEL: @main()
int main() {
int main(void) {
int i;
// CHECK: [[DIMS:%.+]] = alloca [1 x [[KMP_DIM]]],
// CHECK-NORMAL: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT:%.+]])
@ -42,7 +42,7 @@ int main() {
for (i = 0; i < n; ++i) {
a[i] = b[i] + 1;
foo();
// CHECK: call void (...) [[FOO:.+]](
// CHECK: call void @foo()
// CHECK: load i32, i32* [[I:%.+]],
// CHECK-NEXT: sub nsw i32 %{{.+}}, 0
// CHECK-NEXT: sdiv i32 %{{.+}}, 1
@ -56,7 +56,7 @@ int main() {
#pragma omp ordered depend(source)
c[i] = c[i] + 1;
foo();
// CHECK: call void (...) [[FOO]]
// CHECK: call void @foo()
// CHECK: load i32, i32* [[I]],
// CHECK-NEXT: sub nsw i32 %{{.+}}, 2
// CHECK-NEXT: sub nsw i32 %{{.+}}, 0

View File

@ -8,7 +8,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel for'}}
#pragma omp parallel for foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp parallel for
for (i = 0; i < 16; ++i)
@ -19,7 +19,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -46,7 +46,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel for' are ignored}}
#pragma omp parallel for foo bar
@ -54,7 +54,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel for' are ignored}}
@ -73,9 +73,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp parallel for collapse
@ -174,7 +174,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -216,7 +216,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -258,7 +258,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -300,7 +300,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp parallel for

View File

@ -10,7 +10,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel for simd'}}
#pragma omp parallel for simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp parallel for simd
for (i = 0; i < 16; ++i)
@ -21,7 +21,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -49,7 +49,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
@ -58,7 +58,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -85,8 +85,8 @@ void test_non_identifiers() {
;
}
extern int foo();
void test_safelen() {
extern int foo(void);
void test_safelen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp parallel for simd safelen
@ -171,7 +171,7 @@ void test_safelen() {
;
}
void test_simdlen() {
void test_simdlen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp parallel for simd simdlen
@ -256,7 +256,7 @@ void test_simdlen() {
;
}
void test_safelen_simdlen() {
void test_safelen_simdlen(void) {
int i;
// expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
#pragma omp parallel for simd simdlen(6) safelen(5)
@ -268,7 +268,7 @@ void test_safelen_simdlen() {
;
}
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -384,7 +384,7 @@ void test_collapse() {
i += j;
}
void test_linear() {
void test_linear(void) {
int i;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp parallel for simd linear(
@ -489,7 +489,7 @@ void test_linear() {
;
}
void test_aligned() {
void test_aligned(void) {
int i;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp parallel for simd aligned(
@ -587,7 +587,7 @@ void test_aligned() {
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -638,7 +638,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -689,7 +689,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -740,7 +740,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}
@ -756,7 +756,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp parallel for simd nontemporal(

View File

@ -15,7 +15,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel master taskloop'}}
#pragma omp parallel master taskloop foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp parallel master taskloop
for (i = 0; i < 16; ++i)
@ -26,7 +26,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -54,7 +54,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i, a;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop' are ignored}}
#pragma omp parallel master taskloop foo bar
@ -70,7 +70,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -98,9 +98,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -208,7 +208,7 @@ void test_collapse() {
;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -259,7 +259,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -310,7 +310,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -361,7 +361,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}

View File

@ -17,7 +17,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel master taskloop simd'}}
#pragma omp parallel master taskloop simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp parallel master taskloop simd
for (i = 0; i < 16; ++i)
@ -28,7 +28,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -56,7 +56,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i, a;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel master taskloop simd' are ignored}}
#pragma omp parallel master taskloop simd foo bar
@ -72,7 +72,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -99,9 +99,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -209,7 +209,7 @@ void test_collapse() {
;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -260,7 +260,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -311,7 +311,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -362,7 +362,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}
@ -384,7 +384,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp parallel master taskloop simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp parallel master taskloop simd nontemporal(

View File

@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
void foo();
void foo(void);
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel sections'}}
#pragma omp parallel sections
@ -10,7 +10,7 @@ void foo();
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel sections'}}
#pragma omp parallel sections foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp parallel sections
{
@ -29,7 +29,7 @@ void test_no_clause() {
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -68,7 +68,7 @@ L1:
goto L3; // expected-error {{use of undeclared label 'L3'}}
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
#pragma omp parallel sections foo bar
@ -80,7 +80,7 @@ void test_invalid_clause() {
}
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
@ -108,7 +108,7 @@ void test_non_identifiers() {
}
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -158,7 +158,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -209,7 +209,7 @@ void test_lastprivate() {
}
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}

View File

@ -10,7 +10,7 @@ void xxx(int argc) {
}
}
void foo();
void foo(void);
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp sections'}}
#pragma omp sections
@ -18,7 +18,7 @@ void foo();
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp sections'}}
#pragma omp sections foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp sections
{
@ -50,7 +50,7 @@ void test_no_clause() {
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -100,7 +100,7 @@ L1:
goto L3; // expected-error {{use of undeclared label 'L3'}}
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp sections' are ignored}}
@ -113,7 +113,7 @@ void test_invalid_clause() {
}
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -145,7 +145,7 @@ void test_non_identifiers() {
}
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -204,7 +204,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -264,7 +264,7 @@ void test_lastprivate() {
}
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -324,7 +324,7 @@ void test_firstprivate() {
}
}
void test_nowait() {
void test_nowait(void) {
#pragma omp parallel
#pragma omp sections nowait nowait // expected-error {{directive '#pragma omp sections' cannot contain more than one 'nowait' clause}}
{

View File

@ -20,7 +20,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp simd'}}
#pragma omp simd safelen(4)
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp simd
for (i = 0; i < 16; ++i)
@ -31,7 +31,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -58,7 +58,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp simd' are ignored}}
#pragma omp simd foo bar
@ -66,7 +66,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp simd' are ignored}}
@ -90,8 +90,8 @@ void test_non_identifiers() {
;
}
extern int foo();
void test_safelen() {
extern int foo(void);
void test_safelen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp simd safelen
@ -177,7 +177,7 @@ void test_safelen() {
;
}
void test_simdlen() {
void test_simdlen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp simd simdlen
@ -262,7 +262,7 @@ void test_simdlen() {
;
}
void test_safelen_simdlen() {
void test_safelen_simdlen(void) {
int i;
// expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
#pragma omp simd simdlen(6) safelen(5)
@ -274,7 +274,7 @@ void test_safelen_simdlen() {
;
}
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp simd collapse
@ -381,7 +381,7 @@ void test_collapse() {
i += j;
}
void test_linear() {
void test_linear(void) {
int i;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp simd linear(
@ -485,7 +485,7 @@ void test_linear() {
;
}
void test_aligned() {
void test_aligned(void) {
int i;
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp simd aligned(
@ -582,7 +582,7 @@ void test_aligned() {
;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -624,7 +624,7 @@ void test_private() {
}
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 {{unexpected OpenMP clause 'firstprivate' in directive '#pragma omp simd'}}
@ -634,7 +634,7 @@ void test_firstprivate() {
;
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -676,7 +676,7 @@ void test_lastprivate() {
;
}
void test_reduction() {
void test_reduction(void) {
int i, x, y;
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 {{expected identifier}}
@ -778,7 +778,7 @@ void test_reduction() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp simd
@ -806,7 +806,7 @@ void linear_modifiers(int argc) {
for (int k = 0; k < argc; ++k) ++k;
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp simd nontemporal(

View File

@ -8,7 +8,7 @@ void xxx(int argc) {
argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
}
void foo();
void foo(void);
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp single'}}
#pragma omp single
@ -16,7 +16,7 @@ void foo();
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp single'}}
#pragma omp single foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp single
foo();
@ -25,7 +25,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -53,7 +53,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp single' are ignored}}
@ -61,7 +61,7 @@ void test_invalid_clause() {
foo();
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -85,7 +85,7 @@ void test_non_identifiers() {
foo();
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -126,7 +126,7 @@ void test_private() {
foo();
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -157,7 +157,7 @@ void test_firstprivate() {
foo();
}
void test_nowait() {
void test_nowait(void) {
#pragma omp single nowait nowait // expected-error {{directive '#pragma omp single' cannot contain more than one 'nowait' clause}}
for (int i = 0; i < 16; ++i)
;

View File

@ -4,7 +4,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp45 -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify=expected,omp50 -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 -o - %s -Wuninitialized
void foo() { }
void foo(void) { }
void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}

View File

@ -8,7 +8,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for'}}
#pragma omp target parallel for foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target parallel for
for (i = 0; i < 16; ++i)
@ -19,7 +19,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -46,7 +46,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
#pragma omp target parallel for foo bar
@ -54,7 +54,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
@ -73,9 +73,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target parallel for collapse
@ -174,7 +174,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -216,7 +216,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -258,7 +258,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -300,7 +300,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target parallel for

View File

@ -10,7 +10,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for simd'}}
#pragma omp target parallel for simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target parallel for simd
for (i = 0; i < 16; ++i)
@ -21,7 +21,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -48,7 +48,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
#pragma omp target parallel for simd foo bar
@ -56,7 +56,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
@ -75,9 +75,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target parallel for simd collapse
@ -176,7 +176,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -218,7 +218,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -260,7 +260,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -302,7 +302,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target parallel for simd
@ -316,7 +316,7 @@ void test_loop_messages() {
}
}
void test_safelen() {
void test_safelen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target parallel for simd safelen
@ -401,7 +401,7 @@ void test_safelen() {
;
}
void test_simdlen() {
void test_simdlen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target parallel for simd simdlen
@ -486,7 +486,7 @@ void test_simdlen() {
;
}
void test_safelen_simdlen() {
void test_safelen_simdlen(void) {
int i;
// expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
#pragma omp target parallel for simd simdlen(6) safelen(5)
@ -498,7 +498,7 @@ void test_safelen_simdlen() {
;
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target parallel for simd nontemporal(

View File

@ -10,7 +10,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target simd'}}
#pragma omp target simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target simd
for (i = 0; i < 16; ++i)
@ -21,7 +21,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -48,7 +48,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target simd' are ignored}}
#pragma omp target simd foo bar
@ -56,7 +56,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target simd' are ignored}}
@ -75,9 +75,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target simd collapse
@ -166,7 +166,7 @@ void test_collapse() {
;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -208,7 +208,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -250,7 +250,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -292,7 +292,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target simd
@ -306,7 +306,7 @@ void test_loop_messages() {
}
}
void test_safelen() {
void test_safelen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target simd safelen
@ -391,7 +391,7 @@ void test_safelen() {
;
}
void test_simdlen() {
void test_simdlen(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target simd simdlen
@ -476,7 +476,7 @@ void test_simdlen() {
;
}
void test_safelen_simdlen() {
void test_safelen_simdlen(void) {
int i;
// expected-error@+1 {{the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter}}
#pragma omp target simd simdlen(6) safelen(5)
@ -488,7 +488,7 @@ void test_safelen_simdlen() {
;
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target simd nontemporal(

View File

@ -8,7 +8,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute'}}
#pragma omp target teams distribute foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target teams distribute
for (i = 0; i < 16; ++i)
@ -19,7 +19,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -46,7 +46,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
#pragma omp target teams distribute foo bar
@ -54,7 +54,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
@ -73,9 +73,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target teams distribute collapse
@ -172,7 +172,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -214,7 +214,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -256,7 +256,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -301,7 +301,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target teams distribute

View File

@ -8,7 +8,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute parallel for'}}
#pragma omp target teams distribute parallel for foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target teams distribute parallel for
for (i = 0; i < 16; ++i)
@ -19,7 +19,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -46,7 +46,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
#pragma omp target teams distribute parallel for foo bar
@ -54,7 +54,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
@ -73,9 +73,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target teams distribute parallel for collapse
@ -172,7 +172,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -214,7 +214,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -256,7 +256,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -301,7 +301,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target teams distribute parallel for

View File

@ -10,7 +10,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute parallel for simd'}}
#pragma omp target teams distribute parallel for simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target teams distribute parallel for simd
for (i = 0; i < 16; ++i)
@ -21,7 +21,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -48,7 +48,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
#pragma omp target teams distribute parallel for simd foo bar
@ -56,7 +56,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
@ -75,9 +75,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target teams distribute parallel for simd collapse
@ -174,7 +174,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -216,7 +216,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -258,7 +258,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -307,7 +307,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target teams distribute parallel for simd
@ -321,7 +321,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute parallel for simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target teams distribute parallel for simd nontemporal(

View File

@ -10,7 +10,7 @@
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute simd'}}
#pragma omp target teams distribute simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp target teams distribute simd
for (i = 0; i < 16; ++i)
@ -21,7 +21,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -48,7 +48,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
#pragma omp target teams distribute simd foo bar
@ -56,7 +56,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
@ -75,9 +75,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
// expected-error@+1 {{expected '('}}
#pragma omp target teams distribute simd collapse
@ -174,7 +174,7 @@ void test_collapse() {
i += j;
}
void test_private() {
void test_private(void) {
int i;
// expected-error@+2 {{expected expression}}
// expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
@ -216,7 +216,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -258,7 +258,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
// expected-error@+1 {{expected expression}}
@ -307,7 +307,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
// expected-error@+2 {{variable must be of integer or pointer type}}
#pragma omp target teams distribute simd
@ -321,7 +321,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp target teams distribute simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp target teams distribute simd nontemporal(

View File

@ -21,7 +21,7 @@ enum omp_allocator_handle_t {
};
// CHECK: define {{.*}}[[FIE:@.+]]()
void fie() {
void fie(void) {
int x;
#pragma omp target uses_allocators(omp_null_allocator) allocate(omp_null_allocator: x) firstprivate(x)
{}

View File

@ -13,10 +13,10 @@
typedef void *omp_depend_t;
typedef __UINTPTR_TYPE__ omp_event_handle_t;
void foo();
void foo(void);
// CHECK-LABEL: @main
int main() {
int main(void) {
omp_depend_t d, x;
omp_event_handle_t evt;
int a, *b;
@ -131,7 +131,7 @@ int main() {
// CHECK: call void @__kmpc_end_taskgroup(
// CHECK-LINE: @bar
void bar() {
void bar(void) {
int **a;
// CHECK: call void @__kmpc_for_static_init_4(
#pragma omp for

View File

@ -11,7 +11,7 @@
#ifndef HEADER
#define HEADER
void test_task_affinity() {
void test_task_affinity(void) {
int t;
#pragma omp task
{

View File

@ -15,7 +15,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp taskloop'}}
#pragma omp taskloop foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp taskloop
for (i = 0; i < 16; ++i)
@ -26,7 +26,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -54,7 +54,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
@ -67,7 +67,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -95,9 +95,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -205,7 +205,7 @@ void test_collapse() {
;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -256,7 +256,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -307,7 +307,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -358,7 +358,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}

View File

@ -17,7 +17,7 @@ void xxx(int argc) {
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp taskloop simd'}}
#pragma omp taskloop simd foo
void test_no_clause() {
void test_no_clause(void) {
int i;
#pragma omp taskloop simd
for (i = 0; i < 16; ++i)
@ -28,7 +28,7 @@ void test_no_clause() {
++i;
}
void test_branch_protected_scope() {
void test_branch_protected_scope(void) {
int i = 0;
L1:
++i;
@ -56,7 +56,7 @@ L1:
goto L1;
}
void test_invalid_clause() {
void test_invalid_clause(void) {
int i;
#pragma omp parallel
// expected-warning@+1 {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
@ -69,7 +69,7 @@ void test_invalid_clause() {
;
}
void test_non_identifiers() {
void test_non_identifiers(void) {
int i, x;
#pragma omp parallel
@ -96,9 +96,9 @@ void test_non_identifiers() {
;
}
extern int foo();
extern int foo(void);
void test_collapse() {
void test_collapse(void) {
int i;
#pragma omp parallel
// expected-error@+1 {{expected '('}}
@ -206,7 +206,7 @@ void test_collapse() {
;
}
void test_private() {
void test_private(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected expression}}
@ -257,7 +257,7 @@ void test_private() {
}
}
void test_lastprivate() {
void test_lastprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -308,7 +308,7 @@ void test_lastprivate() {
;
}
void test_firstprivate() {
void test_firstprivate(void) {
int i;
#pragma omp parallel
// expected-error@+2 {{expected ')'}} expected-note@+2 {{to match this '('}}
@ -363,7 +363,7 @@ void test_firstprivate() {
;
}
void test_loop_messages() {
void test_loop_messages(void) {
float a[100], b[100], c[100];
#pragma omp parallel
// expected-error@+2 {{variable must be of integer or pointer type}}
@ -385,7 +385,7 @@ void test_loop_messages() {
}
}
void test_nontemporal() {
void test_nontemporal(void) {
int i;
// omp45-error@+1 {{unexpected OpenMP clause 'nontemporal' in directive '#pragma omp taskloop simd'}} expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp taskloop simd nontemporal(

View File

@ -5,7 +5,7 @@
int a;
void foo() {
void foo(void) {
int(*b)[a];
int *(**c)[a];
#pragma omp parallel if (0)

View File

@ -3,16 +3,16 @@
typedef const void *CFTypeRef;
typedef const struct __CFString *CFStringRef;
CFTypeRef CFCreateSomething();
CFStringRef CFCreateString();
CFTypeRef CFGetSomething();
CFStringRef CFGetString();
CFTypeRef CFCreateSomething(void);
CFStringRef CFCreateString(void);
CFTypeRef CFGetSomething(void);
CFStringRef CFGetString(void);
@interface NSString
@end
id CreateSomething();
NSString *CreateNSString();
id CreateSomething(void);
NSString *CreateNSString(void);
#if __has_feature(objc_arc)
#define BRIDGE __bridge

View File

@ -1,11 +1,11 @@
void f();
void f(void);
struct one {};
void two();
void two(void);
void many(int i);
struct many;
void many(int j);
struct many;
void noret();
void noret(void);

View File

@ -1,7 +1,7 @@
void g();
void g(void);
struct two {};
void one();
void one(void);
struct three {}; // for verification
void many(int k);
@ -9,4 +9,4 @@ struct many;
void many(int l);
struct many {};
void noret() __attribute__((noreturn));
void noret(void) __attribute__((noreturn));

Some files were not shown because too many files have changed in this diff Show More