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 sixth 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-09 17:13:53 -05:00
parent f8701a30f6
commit 7de7161304
122 changed files with 528 additions and 528 deletions

View File

@ -29,11 +29,11 @@
// CHECK-ERROR: error: invalid integral value '16.0.0' in '-ffuchsia-api-level=16.0.0'
#if __Fuchsia_API_level__ >= 16
void f16() {
void f16(void) {
}
#else
void f15() {
void f15(void) {
}
#endif

View File

@ -4,7 +4,7 @@
// RUN: %clang -Wfoobar -no-canonical-prefixes -target x86_64-apple-darwin10 -fsyntax-only %s
// RUN: FileCheck %s < %t.log
int f0() {}
int f0(void) {}
// CHECK: <dict>
// CHECK: <key>main-file</key>
@ -27,7 +27,7 @@ int f0() {}
// CHECK: <key>line</key>
// CHECK: <integer>7</integer>
// CHECK: <key>column</key>
// CHECK: <integer>11</integer>
// CHECK: <integer>15</integer>
// CHECK: <key>message</key>
// CHECK: <string>non-void function does not return a value</string>
// CHECK: </dict>

View File

@ -772,4 +772,4 @@
// FAKEDIR: "-libpath:/foo{{/|\\\\}}Lib{{/|\\\\}}10.0.12345.0{{/|\\\\}}ucrt
// FAKEDIR: "-libpath:/foo{{/|\\\\}}Lib{{/|\\\\}}10.0.12345.0{{/|\\\\}}um
void f() { }
void f(void) { }

View File

@ -133,5 +133,5 @@
// tune: "-target-cpu" "sandybridge"
// tune-SAME: "-tune-cpu" "haswell"
void f() {
void f(void) {
}

View File

@ -6,8 +6,8 @@
// CHECK-NOT: msgSend_fixup_alloc
// CHECK: OBJC_SELECTOR_REFERENCES
int f0() {
return ^(){ return 0; }();
int f0(void) {
return ^(void){ return 0; }();
}
@interface I0
@ -22,7 +22,7 @@ int f0() {
+(id) alloc;
@end
void f1() {
void f1(void) {
[I1 alloc];
}

View File

@ -12,4 +12,4 @@
// LEGACYPM: Pass Arguments:
void f() {}
void f(void) {}

View File

@ -1,11 +1,11 @@
// RUN: %clang -target x86_64-apple-darwin9 \
// RUN: -fsyntax-only -fno-exceptions %s
void f1() {
void f1(void) {
@throw @"A";
}
void f0() {
void f0(void) {
@try {
f1();
} @catch (id x) {
@ -13,7 +13,7 @@ void f0() {
}
}
int main() {
int main(void) {
f0();
return 0;
}

View File

@ -12,5 +12,5 @@
// FIXME: Check for the dummy output now to verify that the custom action was executed.
// RUN: %clang -extract-api %s | FileCheck -check-prefix DUMMY-OUTPUT %s
void dummy_function();
void dummy_function(void);
// DUMMY-OUTPUT: dummy_function

View File

@ -5,7 +5,7 @@
// For 64-bit iOS, automatically promote -Wimplicit-function-declaration
// to an error.
void radar_10894044() {
void radar_10894044(void) {
printf("Hi\n"); // expected-error {{implicitly declaring library function 'printf' with type 'int (const char *, ...)'}} expected-note {{include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
radar_10894044_not_declared(); // expected-error {{implicit declaration of function 'radar_10894044_not_declared' is invalid in C99}}
}

View File

@ -2,7 +2,7 @@
// expected-no-diagnostics
// rdar://8949617
void * FOO() {
void * FOO(void) {
id string = @"Hello World.\n";
void *pointer = string; // No error must be issued
return pointer;

View File

@ -17,7 +17,7 @@
// RUN: -mcpu=power7 -mprivileged %s 2>&1 | FileCheck %s --check-prefix=NOPRIV
// __SP__ TODO: Fix this test case to check for the attribute.
int test() {
int test(void) {
return 0;
}

View File

@ -38,7 +38,7 @@
// RUN: -mpcrel -mprefixed %s 2>&1 | FileCheck %s \
// RUN: --check-prefix=NOPCREL-PREFIX
int test_p10_features() {
int test_p10_features(void) {
return 0;
}

View File

@ -3,4 +3,4 @@
// RUN: %clang -target i386-unknown-unknown -mred-zone %s -S -emit-llvm -o %t.log
// RUN: grep -v 'noredzone' %t.log
int foo() { return 42; }
int foo(void) { return 42; }

View File

@ -329,46 +329,46 @@ int size_a_ld = sizeof(_Atomic(long double));
// Check types
// CHECK: zeroext i8 @check_char()
char check_char() { return 0; }
char check_char(void) { return 0; }
// CHECK: define dso_local signext i16 @check_short()
short check_short() { return 0; }
short check_short(void) { return 0; }
// CHECK: define dso_local i32 @check_int()
int check_int() { return 0; }
int check_int(void) { return 0; }
// CHECK: define dso_local i32 @check_wchar_t()
int check_wchar_t() { return 0; }
int check_wchar_t(void) { return 0; }
// CHECK: define dso_local i32 @check_long()
long check_long() { return 0; }
long check_long(void) { return 0; }
// CHECK: define dso_local i64 @check_longlong()
long long check_longlong() { return 0; }
long long check_longlong(void) { return 0; }
// CHECK: define dso_local zeroext i8 @check_uchar()
unsigned char check_uchar() { return 0; }
unsigned char check_uchar(void) { return 0; }
// CHECK: define dso_local zeroext i16 @check_ushort()
unsigned short check_ushort() { return 0; }
unsigned short check_ushort(void) { return 0; }
// CHECK: define dso_local i32 @check_uint()
unsigned int check_uint() { return 0; }
unsigned int check_uint(void) { return 0; }
// CHECK: define dso_local i32 @check_ulong()
unsigned long check_ulong() { return 0; }
unsigned long check_ulong(void) { return 0; }
// CHECK: define dso_local i64 @check_ulonglong()
unsigned long long check_ulonglong() { return 0; }
unsigned long long check_ulonglong(void) { return 0; }
// CHECK: define dso_local i32 @check_size_t()
size_t check_size_t() { return 0; }
size_t check_size_t(void) { return 0; }
// CHECK: define dso_local float @check_float()
float check_float() { return 0; }
float check_float(void) { return 0; }
// CHECK: define dso_local double @check_double()
double check_double() { return 0; }
double check_double(void) { return 0; }
// CHECK: define dso_local fp128 @check_longdouble()
long double check_longdouble() { return 0; }
long double check_longdouble(void) { return 0; }

View File

@ -285,46 +285,46 @@ int size_a_ld = sizeof(_Atomic(long double));
// Check types
// CHECK: define dso_local zeroext i8 @check_char()
char check_char() { return 0; }
char check_char(void) { return 0; }
// CHECK: define dso_local signext i16 @check_short()
short check_short() { return 0; }
short check_short(void) { return 0; }
// CHECK: define dso_local signext i32 @check_int()
int check_int() { return 0; }
int check_int(void) { return 0; }
// CHECK: define dso_local signext i32 @check_wchar_t()
int check_wchar_t() { return 0; }
int check_wchar_t(void) { return 0; }
// CHECK: define dso_local i64 @check_long()
long check_long() { return 0; }
long check_long(void) { return 0; }
// CHECK: define dso_local i64 @check_longlong()
long long check_longlong() { return 0; }
long long check_longlong(void) { return 0; }
// CHECK: define dso_local zeroext i8 @check_uchar()
unsigned char check_uchar() { return 0; }
unsigned char check_uchar(void) { return 0; }
// CHECK: define dso_local zeroext i16 @check_ushort()
unsigned short check_ushort() { return 0; }
unsigned short check_ushort(void) { return 0; }
// CHECK: define dso_local signext i32 @check_uint()
unsigned int check_uint() { return 0; }
unsigned int check_uint(void) { return 0; }
// CHECK: define dso_local i64 @check_ulong()
unsigned long check_ulong() { return 0; }
unsigned long check_ulong(void) { return 0; }
// CHECK: define dso_local i64 @check_ulonglong()
unsigned long long check_ulonglong() { return 0; }
unsigned long long check_ulonglong(void) { return 0; }
// CHECK: define dso_local i64 @check_size_t()
size_t check_size_t() { return 0; }
size_t check_size_t(void) { return 0; }
// CHECK: define dso_local float @check_float()
float check_float() { return 0; }
float check_float(void) { return 0; }
// CHECK: define dso_local double @check_double()
double check_double() { return 0; }
double check_double(void) { return 0; }
// CHECK: define dso_local fp128 @check_longdouble()
long double check_longdouble() { return 0; }
long double check_longdouble(void) { return 0; }

View File

@ -15,7 +15,7 @@
// RUN: %clang -c --target=powerpc64-ibm-aix -fsyntax-only %s \
// RUN: 2>&1
void a() {
void a(void) {
__int128_t s;
__uint128_t t;
}

View File

@ -20,7 +20,7 @@
// CMD: "-target-feature" "-sse"
// CMD-AFTER: "-target-feature" "+avx2"
void foo() { }
void foo(void) { }
// IR-GPR: attributes {{.*}} = { {{.*}} "target-features"="{{.*}}-avx{{.*}}-avx2{{.*}}-avx512f{{.*}}-sse{{.*}}-sse2{{.*}}-ssse3{{.*}}-x87{{.*}}"
// IR-AVX2: attributes {{.*}} = { {{.*}} "target-features"="{{.*}}+avx{{.*}}+avx2{{.*}}+sse{{.*}}+sse2{{.*}}+ssse3{{.*}}-avx512f{{.*}}-x87{{.*}}"

View File

@ -5,7 +5,7 @@
// rdar://9036633
int main() {
int main(void) {
auto int i = 0;
return i;
}

View File

@ -6,7 +6,7 @@
void object_setClass(id, id);
Class object_getClass(id);
id rhs();
id rhs(void);
Class pr6302(id x123) {
x123->isa = 0;

View File

@ -5,7 +5,7 @@ int function(void);
void anotherFunction(int function);
int use() {
int use(void) {
function();
// CHECK: fix-it:{{.*}}:{[[@LINE-1]]:3-[[@LINE-1]]:3}:"if (@available(macCatalyst 13.2, *)) {\n "
// CHECK-NEXT: fix-it:{{.*}}:{[[@LINE-2]]:14-[[@LINE-2]]:14}:"\n } else {\n // Fallback on earlier versions\n }"

View File

@ -3,7 +3,7 @@
__attribute__((availability(macos, introduced=10.12)))
int function(void);
void use() {
void use(void) {
function();
// CHECK: fix-it:{{.*}}:{[[@LINE-1]]:3-[[@LINE-1]]:3}:"if (__builtin_available(macOS 10.12, *)) {\n "
// CHECK-NEXT: fix-it:{{.*}}:{[[@LINE-2]]:14-[[@LINE-2]]:14}:"\n } else {\n // Fallback on earlier versions\n }"

View File

@ -11,7 +11,7 @@
I* pi;
I* foobar();
I* foobar(void);
@implementation I
- (id) PrivInstMeth {

View File

@ -16,19 +16,19 @@ struct Point {
float x, y, z;
};
struct Point *get_origin();
struct Point *get_origin(void);
void test_point() {
void test_point(void) {
(void)get_origin->x; // expected-error {{base of member reference is a function; perhaps you meant to call it with no arguments?}}
}
// These errors require C11.
#if __STDC_VERSION__ > 199901L
void noreturn_1() _Noreturn; // expected-error {{must precede function declarator}}
void noreturn_1() {
void noreturn_1(void) _Noreturn; // expected-error {{must precede function declarator}}
void noreturn_1(void) {
return; // expected-warning {{should not return}}
}
void noreturn_2() _Noreturn { // expected-error {{must precede function declarator}}
void noreturn_2(void) _Noreturn { // expected-error {{must precede function declarator}}
return; // expected-warning {{should not return}}
}
#endif

View File

@ -16,9 +16,9 @@ typedef int CFIndex;
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
CFIndex getCFIndex();
NSInteger getNSInteger();
NSUInteger getNSUInteger();
CFIndex getCFIndex(void);
NSInteger getNSInteger(void);
NSUInteger getNSUInteger(void);
#define Log1(...) \
do { \
@ -37,7 +37,7 @@ do { \
printf(X, Z); \
} while (0) \
void test() {
void test(void) {
printf("test 1: %s", getNSInteger());
// CHECK: printf("test 1: %ld", (long)getNSInteger());
printf("test 2: %s %s", getNSInteger(), getNSInteger());
@ -71,14 +71,14 @@ do { \
Outer1(__VA_ARGS__); Outer1(__VA_ARGS__); \
} while (0)
void bug33447() {
void bug33447(void) {
Outer2("test 8: %s", getNSInteger());
// CHECK: Outer2("test 8: %ld", (long)getNSInteger());
Outer2("test 9: %s %s", getNSInteger(), getNSInteger());
// CHECK: Outer2("test 9: %ld %ld", (long)getNSInteger(), (long)getNSInteger());
}
void testCFIndex() {
void testCFIndex(void) {
printf("test 10: %s", getCFIndex());
// CHECK: printf("test 10: %ld", (long)getCFIndex());
printf("test 11: %s %s", getCFIndex(), getCFIndex());

View File

@ -4,10 +4,10 @@
int printf(const char *restrict, ...);
typedef unsigned int NSUInteger;
typedef int NSInteger;
NSUInteger getNSUInteger();
NSInteger getNSInteger();
NSUInteger getNSUInteger(void);
NSInteger getNSInteger(void);
void test() {
void test(void) {
// For thumbv7-apple-ios8.0.0 the underlying type of ssize_t is long
// and the underlying type of size_t is unsigned long.

View File

@ -5,10 +5,10 @@
int printf(const char * restrict, ...);
typedef unsigned int NSUInteger;
typedef int NSInteger;
NSUInteger getNSUInteger();
NSInteger getNSInteger();
NSUInteger getNSUInteger(void);
NSInteger getNSInteger(void);
void test() {
void test(void) {
// For thumbv7-apple-ios8.0.0 the underlying type of ssize_t is long
// and the underlying type of size_t is unsigned long.

View File

@ -13,7 +13,7 @@
- (id) compare: (id) arg1;
@end
SEL func()
SEL func(void)
{
(void)@selector( compare: );
(void)@selector (compare:);

View File

@ -5,7 +5,7 @@
// CHECK: warning: unused label 'ddd'
// CHECK-NEXT: {{^ ddd:}}
// CHECK-NEXT: {{^ \^~~~$}}
void f() {
void f(void) {
ddd:
;
}

View File

@ -10,7 +10,7 @@ typedef unsigned char BOOL;
@interface NSString<NSObject>
@end
int main() {
int main(void) {
NSString *stringA = @"stringA";
BOOL comparison = stringA==@"stringB";

View File

@ -10,7 +10,7 @@
@protocol X;
void foo() {
void foo(void) {
<X> *P; // expected-warning{{protocol has no object type specified; defaults to qualified 'id'}}
}

View File

@ -4,8 +4,8 @@
// rdar://10817031
int main() {
void (^arc_fail)() = ^() {
int main(void) {
void (^arc_fail)(void) = ^(void) {
#ifdef ARC
// expected-warning@-2 {{block pointer variable 'arc_fail' is null when captured by block}}
#else

View File

@ -19,12 +19,12 @@
+ (id) arrayWithObjects;
@end
NSArray func() {
NSArray func(void) {
NSArray P;
return P;
}
NSArray (func2)() { return 0; }
NSArray (func2)(void) { return 0; }
#ifdef __cplusplus
void test_result_type() {
@ -32,6 +32,6 @@ void test_result_type() {
}
#endif
int main() {
int main(void) {
NSArray pluginNames = [NSArray arrayWithObjects];
}

View File

@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -verify %s
// RUN: %clang_cc1 -fsyntax-only -Wuninitialized -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
_Bool test_bool_no_false() {
_Bool test_bool_no_false(void) {
_Bool var; // expected-note {{initialize}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:12-[[@LINE-1]]:12}:" = 0"
return var; // expected-warning {{uninitialized}}
@ -10,13 +10,13 @@ _Bool test_bool_no_false() {
#define bool _Bool
#define false (bool)0
#define true (bool)1
bool test_bool_with_false() {
bool test_bool_with_false(void) {
bool var; // expected-note {{initialize}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:11}:" = false"
return var; // expected-warning {{uninitialized}}
}
bool test_bool_with_false_undefined() {
bool test_bool_with_false_undefined(void) {
bool
#undef false
var; // expected-note {{initialize}}

View File

@ -74,13 +74,13 @@ void removeUnusedLabels(char c) {
}
int oopsAComma = 0, // expected-error {{';'}}
void oopsMoreCommas() {
void oopsMoreCommas(void) {
static int a[] = { 0, 1, 2 }, // expected-error {{';'}}
static int b[] = { 3, 4, 5 }, // expected-error {{';'}}
&a == &b ? oopsMoreCommas() : removeUnusedLabels(a[0]);
}
int commaAtEndOfStatement() {
int commaAtEndOfStatement(void) {
int a = 1;
a = 5, // expected-error {{';'}}
int m = 5, // expected-error {{';'}}

View File

@ -28,14 +28,14 @@ typedef enum NSIntegerEnum : NSInteger {
EnumValueB
} NSIntegerEnum;
CFIndex getCFIndex();
NSInteger getNSInteger();
NSUInteger getNSUInteger();
SInt32 getSInt32();
UInt32 getUInt32();
NSIntegerEnum getNSIntegerEnum();
CFIndex getCFIndex(void);
NSInteger getNSInteger(void);
NSUInteger getNSUInteger(void);
SInt32 getSInt32(void);
UInt32 getUInt32(void);
NSIntegerEnum getNSIntegerEnum(void);
void testCorrectionInAllCases() {
void testCorrectionInAllCases(void) {
printf("%s", getNSInteger()); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%s", getNSUInteger()); // expected-warning{{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}}
printf("%s", getSInt32()); // expected-warning{{values of type 'SInt32' should not be used as format arguments; add an explicit cast to 'int' instead}}
@ -105,7 +105,7 @@ void testParens(Foo *obj, struct Bar *record) {
#if __LP64__
void testWarn() {
void testWarn(void) {
printf("%d", getNSInteger()); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%u", getNSUInteger()); // expected-warning{{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}}
printf("%ld", getSInt32()); // expected-warning{{values of type 'SInt32' should not be used as format arguments; add an explicit cast to 'int' instead}}
@ -134,7 +134,7 @@ void testWarn() {
// CHECK-64: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:16}:"(long)"
}
void testPreserveHex() {
void testPreserveHex(void) {
printf("%x", getNSInteger()); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%x", getNSUInteger()); // expected-warning{{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}}
@ -155,7 +155,7 @@ void testSignedness(NSInteger i, NSUInteger u) {
// CHECK-64: fix-it:"{{.*}}":{[[@LINE-4]]:11-[[@LINE-4]]:13}:"%ld"
}
void testNoWarn() {
void testNoWarn(void) {
printf("%ld", getNSInteger()); // no-warning
printf("%lu", getNSUInteger()); // no-warning
printf("%d", getSInt32()); // no-warning
@ -165,7 +165,7 @@ void testNoWarn() {
#else
void testWarn() {
void testWarn(void) {
printf("%ld", getNSInteger()); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%lu", getNSUInteger()); // expected-warning{{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}}
printf("%d", getSInt32()); // expected-warning{{values of type 'SInt32' should not be used as format arguments; add an explicit cast to 'int' instead}}
@ -185,7 +185,7 @@ void testWarn() {
// CHECK-32: fix-it:"{{.*}}":{[[@LINE-2]]:17-[[@LINE-2]]:17}:"(long)"
}
void testPreserveHex() {
void testPreserveHex(void) {
printf("%lx", getNSInteger()); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%lx", getNSUInteger()); // expected-warning{{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}}
@ -193,7 +193,7 @@ void testPreserveHex() {
// CHECK-32: fix-it:"{{.*}}":{[[@LINE-3]]:17-[[@LINE-3]]:17}:"(unsigned long)"
}
void testNoWarn() {
void testNoWarn(void) {
printf("%d", getNSInteger()); // no-warning
printf("%u", getNSUInteger()); // no-warning
printf("%ld", getSInt32()); // no-warning
@ -212,7 +212,7 @@ void testSignedness(NSInteger i, NSUInteger u) {
#endif
void testCasts() {
void testCasts(void) {
printf("%s", (NSInteger)0); // expected-warning{{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}}
printf("%s", (NSUInteger)0); // expected-warning{{values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead}}
printf("%s", (SInt32)0); // expected-warning{{values of type 'SInt32' should not be used as format arguments; add an explicit cast to 'int' instead}}
@ -241,7 +241,7 @@ void testCasts() {
// CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:16-[[@LINE-3]]:25}:"(long)"
}
void testCapitals() {
void testCapitals(void) {
printf("%D", 1); // expected-warning{{conversion specifier is not supported by ISO C}} expected-note {{did you mean to use 'd'?}}
printf("%U", 1); // expected-warning{{conversion specifier is not supported by ISO C}} expected-note {{did you mean to use 'u'?}}
printf("%O", 1); // expected-warning{{conversion specifier is not supported by ISO C}} expected-note {{did you mean to use 'o'?}}

View File

@ -177,7 +177,7 @@ void test_char(char c, signed char s, unsigned char u, uint8_t n) {
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:15}:"%d"
}
void multichar_constants_false_negative() {
void multichar_constants_false_negative(void) {
// The value of a multi-character constant is implementation-defined, but
// almost certainly shouldn't be printed with %c. However, the current
// type-checker expects %c to correspond to an integer argument, because
@ -188,7 +188,7 @@ void multichar_constants_false_negative() {
}
void test_percent_C() {
void test_percent_C(void) {
const unsigned short data = 'a';
NSLog(@"%C", data); // no-warning
@ -233,7 +233,7 @@ void testSignedness(long i, unsigned long u) {
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:11-[[@LINE-2]]:14}:"%+ld"
}
void testSizeTypes() {
void testSizeTypes(void) {
printf("%zu", 0.f); // expected-warning-re{{format specifies type 'size_t' (aka '{{.+}}') but the argument has type 'float'}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:11-[[@LINE-1]]:14}:"%f"
@ -260,7 +260,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
short : (unsigned short)0, \
signed char : (unsigned char)0))
void testPtrDiffTypes() {
void testPtrDiffTypes(void) {
__UNSIGNED_PTRDIFF_TYPE__ p1 = 0;
printf("%tu", p1); // No warning.
@ -291,7 +291,7 @@ void testPtrDiffTypes() {
#endif // !defined(__ANDROID__) && !defined(__Fuchsia__)
}
void testEnum() {
void testEnum(void) {
typedef enum {
ImplicitA = 1,
ImplicitB = 2

View File

@ -9,7 +9,7 @@
- (void)testDataSource:(id)object withMultipleArguments:(id)arguments;
@end
int main() {
int main(void) {
id obj;
[obj TestDataSource:nil withMultipleArguments:nil];
}

View File

@ -4,7 +4,7 @@
#define va_arg(ap, type) __builtin_va_arg(ap, type)
typedef __builtin_va_list va_list;
void myFunc() {
void myFunc(void) {
va_list values;
int value;

View File

@ -35,7 +35,7 @@ typedef unsigned char BOOL;
@interface NSString : NSObject
@end
void fixes() {
void fixes(void) {
id arr = @[
17, // expected-error{{numeric literal must be prefixed by '@' in a collection}}
'a', // expected-error{{character literal must be prefixed by '@'}}

View File

@ -22,7 +22,7 @@
}
@end
int main()
int main(void)
{
X *obj = [X new];
obj.X = 3;

View File

@ -29,7 +29,7 @@ struct Window window = {
2.71818, 5.0, 6.0, Red
};
void test() {
void test(void) {
Rectangle r1; // expected-error{{must use 'struct' tag to refer to type 'Rectangle'}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:3}:"struct "
r1.top_left.x = 0;

View File

@ -8,7 +8,7 @@
+ (int)method:(int)x;
@end
void test() {
void test(void) {
NSstring *str = @"A string"; // expected-error{{unknown type name 'NSstring'; did you mean 'NSString'?}}
}

View File

@ -1,2 +1,2 @@
#line 1 "foo.h"
foo();
foo(void);

View File

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

View File

@ -1,3 +1,3 @@
int f() {
int f(void) {
// Oops, no return.
}

View File

@ -1,2 +1,2 @@
#line 10 "foo.h"
foo(); // will warn if not treated as a system header
foo(void); // will warn if not treated as a system header

View File

@ -1,4 +1,4 @@
void f()
void f(void)
{
int unused_variable;
}

View File

@ -12,6 +12,6 @@
// For files which don't exist, just print the filename.
#line 123 "non-existant.c"
int g() {}
// NORMAL: non-existant.c:123:10: warning: non-void function does not return a value
// ABSOLUTE: non-existant.c:123:10: warning: non-void function does not return a value
int g(void) {}
// NORMAL: non-existant.c:123:14: warning: non-void function does not return a value
// ABSOLUTE: non-existant.c:123:14: warning: non-void function does not return a value

View File

@ -9,5 +9,5 @@ __asm__("foo");
int g0;
// CHECK: define dso_local i32 @f0()
int f0() {
int f0(void) {
}

View File

@ -3,6 +3,6 @@
// RUN: env SDKROOT="/" %clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast
// RUN: diff %t1.ll %t2.ll
int main() {
int main(void) {
return 0;
}

View File

@ -18,7 +18,7 @@ extern void doIt(char *);
// REGULAR: warning: stack frame size ([[#]]) exceeds limit ([[#]]) in 'stackSizeWarning'
// PROMOTE: error: stack frame size ([[#]]) exceeds limit ([[#]]) in 'stackSizeWarning'
// IGNORE-NOT: stack frame size ([[#]]) exceeds limit ([[#]]) in 'stackSizeWarning'
void stackSizeWarning() {
void stackSizeWarning(void) {
char buffer[80];
doIt(buffer);
}

View File

@ -20,11 +20,11 @@
// CHECK-BC-LABEL: attributes #0 = {{.*}} alwaysinline
// CHECK-CMD: -O2
__attribute__((always_inline)) void bar() {
__attribute__((always_inline)) void bar(void) {
return;
}
void foo() {
void foo(void) {
bar();
return;
}

View File

@ -36,7 +36,7 @@ _Bool b;
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sadd_sasasa() {
void sadd_sasasa(void) {
sa = sa + sa;
}
@ -50,7 +50,7 @@ void sadd_sasasa() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sadd_asaa() {
void sadd_asaa(void) {
a = sa + a;
}
@ -63,7 +63,7 @@ void sadd_asaa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sadd_sasasf() {
void sadd_sasasf(void) {
sa = sa + sf;
}
@ -80,7 +80,7 @@ void sadd_sasasf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sadd_sasaf() {
void sadd_sasaf(void) {
sa = sa + f;
}
@ -94,7 +94,7 @@ void sadd_sasaf() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sadd_aasf() {
void sadd_aasf(void) {
a = a + sf;
}
@ -111,7 +111,7 @@ void sadd_aasf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sadd_aalf() {
void sadd_aalf(void) {
a = a + lf;
}
@ -136,7 +136,7 @@ void sadd_aalf() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void sadd_sasausa() {
void sadd_sasausa(void) {
sa = sa + usa;
}
@ -163,7 +163,7 @@ void sadd_sasausa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void sadd_asaua() {
void sadd_asaua(void) {
a = sa + ua;
}
@ -189,7 +189,7 @@ void sadd_asaua() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void sadd_sasausf() {
void sadd_sasausf(void) {
sa = sa + usf;
}
@ -219,7 +219,7 @@ void sadd_sasausf() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void sadd_sasaulf() {
void sadd_sasaulf(void) {
sa = sa + ulf;
}
@ -235,7 +235,7 @@ void sadd_sasaulf() {
// CHECK-NEXT: store i32 [[TMP6]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sadd_aaaaa() {
void sadd_aaaaa(void) {
a = a + a2 + a3 + a4;
}
@ -248,7 +248,7 @@ void sadd_aaaaa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void uadd_usausausa() {
void uadd_usausausa(void) {
usa = usa + usa;
}
@ -262,7 +262,7 @@ void uadd_usausausa() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// CHECK-NEXT: ret void
//
void uadd_uausaua() {
void uadd_uausaua(void) {
ua = usa + ua;
}
@ -275,7 +275,7 @@ void uadd_uausaua() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void uadd_usausausf() {
void uadd_usausausf(void) {
usa = usa + usf;
}
@ -292,7 +292,7 @@ void uadd_usausausf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void uadd_usausauf() {
void uadd_usausauf(void) {
usa = usa + uf;
}
@ -309,7 +309,7 @@ void uadd_usausauf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasai() {
void int_sasai(void) {
sa = sa + i;
}
@ -325,7 +325,7 @@ void int_sasai() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasaui() {
void int_sasaui(void) {
sa = sa + ui;
}
@ -353,7 +353,7 @@ void int_sasaui() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausai() {
void int_usausai(void) {
usa = usa + i;
}
@ -381,7 +381,7 @@ void int_usausai() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausaui() {
void int_usausaui(void) {
usa = usa + ui;
}
@ -397,7 +397,7 @@ void int_usausaui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void int_lflfui() {
void int_lflfui(void) {
lf = lf + ui;
}
@ -415,7 +415,7 @@ void int_lflfui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void int_aab() {
void int_aab(void) {
a = a + b;
}
@ -428,7 +428,7 @@ void int_aab() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasas() {
void sat_sassasas(void) {
sa_sat = sa + sa_sat;
}
@ -450,7 +450,7 @@ void sat_sassasas() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusausas() {
void sat_usasusausas(void) {
usa_sat = usa + usa_sat;
}
@ -476,7 +476,7 @@ void sat_usasusausas() {
// UNSIGNED-NEXT: store i32 [[RESIZE2]], i32* @ua_sat, align 4
// UNSIGNED-NEXT: ret void
//
void sat_uasuausas() {
void sat_uasuausas(void) {
ua_sat = ua + usa_sat;
}
@ -496,7 +496,7 @@ void sat_uasuausas() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasi() {
void sat_sassasi(void) {
sa_sat = sa_sat + i;
}
@ -516,7 +516,7 @@ void sat_sassasi() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasui() {
void sat_sassasui(void) {
sa_sat = sa_sat + ui;
}
@ -538,7 +538,7 @@ void sat_sassasui() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @uf_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_ufsufsufs() {
void sat_ufsufsufs(void) {
uf_sat = uf_sat + uf_sat;
}
@ -574,6 +574,6 @@ void sat_ufsufsufs() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusasi() {
void sat_usasusasi(void) {
usa_sat = usa_sat + i;
}

View File

@ -53,7 +53,7 @@ _Bool b_sne_true = 2.6hk != 2.6uhk;
_Bool b_seq_true = 2.0hk == 2u; // CHECK-DAG: @b_seq_true = {{.*}}global i8 1, align 1
_Bool b_seq_true2 = 2.0uhk == 2; // CHECK-DAG: @b_seq_true2 = {{.*}}global i8 1, align 1
void TestComparisons() {
void TestComparisons(void) {
short _Accum sa;
_Accum a;
unsigned short _Accum usa;
@ -132,7 +132,7 @@ void TestComparisons() {
// CHECK-NEXT: {{.*}} = icmp ule i32 [[UPSCALE_A]], [[A2]]
}
void TestIntComparisons() {
void TestIntComparisons(void) {
short _Accum sa;
unsigned short _Accum usa;
@ -288,7 +288,7 @@ void TestIntComparisons() {
// PADDED-NEXT: {{.*}} = icmp eq i39 [[RESIZE_A]], [[UPSCALE_I]]
}
void TestComparisonSignage() {
void TestComparisonSignage(void) {
short _Accum sa;
unsigned short _Accum usa;
int i;
@ -327,7 +327,7 @@ void TestComparisonSignage() {
// PADDED-NEXT: {{.*}} = icmp eq i39 [[RESIZE_A]], [[UPSCALE_I]]
}
void TestSaturationComparisons() {
void TestSaturationComparisons(void) {
short _Accum sa;
_Accum a;
_Sat short _Accum sat_sa;
@ -361,7 +361,7 @@ void TestSaturationComparisons() {
// PADDED-NEXT: {{.*}} = icmp eq i16 [[A]], [[A2]]
}
void StoreBooleanResult() {
void StoreBooleanResult(void) {
short _Accum sa;
_Accum a;
int res;

View File

@ -31,7 +31,7 @@ float fl;
// CHECK-NEXT: store i8 [[RESIZE1]], i8* @shf, align 1
// CHECK-NEXT: ret void
//
void add_shfa() {
void add_shfa(void) {
shf += a;
}
@ -57,7 +57,7 @@ void add_shfa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void add_auf() {
void add_auf(void) {
a += uf;
}
@ -73,7 +73,7 @@ void add_auf() {
// CHECK-NEXT: store i16 [[RESIZE1]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void add_ufula() {
void add_ufula(void) {
uf += ula;
}
@ -101,7 +101,7 @@ void add_ufula() {
// UNSIGNED-NEXT: store i64 [[TMP2]], i64* @ula, align 8
// UNSIGNED-NEXT: ret void
//
void add_ulashf() {
void add_ulashf(void) {
ula += shf;
}
@ -129,7 +129,7 @@ void add_ulashf() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @uf, align 2
// UNSIGNED-NEXT: ret void
//
void add_ufshf() {
void add_ufshf(void) {
uf += shf;
}
@ -143,7 +143,7 @@ void add_ufshf() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void add_ashf() {
void add_ashf(void) {
a += shf;
}
@ -159,7 +159,7 @@ void add_ashf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void add_ai() {
void add_ai(void) {
a += i;
}
@ -175,7 +175,7 @@ void add_ai() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void add_au() {
void add_au(void) {
a += u;
}
@ -201,7 +201,7 @@ void add_au() {
// UNSIGNED-NEXT: store i64 [[TMP2]], i64* @ula, align 8
// UNSIGNED-NEXT: ret void
//
void add_ulai() {
void add_ulai(void) {
ula += i;
}
@ -231,7 +231,7 @@ void add_ulai() {
// UNSIGNED-NEXT: store i32 [[RESIZE1]], i32* @i, align 4
// UNSIGNED-NEXT: ret void
//
void add_iula() {
void add_iula(void) {
i += ula;
}
@ -253,7 +253,7 @@ void add_iula() {
// CHECK-NEXT: store i8 [[RESIZE3]], i8* @c, align 1
// CHECK-NEXT: ret void
//
void add_ca() {
void add_ca(void) {
c += a;
}
@ -273,7 +273,7 @@ void add_ca() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @sa, align 4
// CHECK-NEXT: ret void
//
void add_sai() {
void add_sai(void) {
sa += i;
}
@ -299,7 +299,7 @@ void add_sai() {
// CHECK-NEXT: store i8 [[RESIZE3]], i8* @c, align 1
// CHECK-NEXT: ret void
//
void add_csa() {
void add_csa(void) {
c += sa;
}
@ -325,7 +325,7 @@ void add_csa() {
// UNSIGNED-NEXT: store i64 [[RESIZE2]], i64* @sula, align 8
// UNSIGNED-NEXT: ret void
//
void add_sulau() {
void add_sulau(void) {
sula += u;
}
@ -356,7 +356,7 @@ void add_sulau() {
// UNSIGNED-NEXT: store i8 [[RESIZE1]], i8* @sshf, align 1
// UNSIGNED-NEXT: ret void
//
void add_sshsuf() {
void add_sshsuf(void) {
sshf += suf;
}
@ -372,7 +372,7 @@ void add_sshsuf() {
// CHECK-NEXT: store i32 [[TMP5]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void add_afl() {
void add_afl(void) {
a += fl;
}
@ -386,7 +386,7 @@ void add_afl() {
// CHECK-NEXT: store float [[ADD]], float* @fl, align 4
// CHECK-NEXT: ret void
//
void add_fla() {
void add_fla(void) {
fl += a;
}
@ -402,7 +402,7 @@ void add_fla() {
// CHECK-NEXT: store i32 [[TMP5]], i32* @sa, align 4
// CHECK-NEXT: ret void
//
void add_safl() {
void add_safl(void) {
sa += fl;
}
@ -416,7 +416,7 @@ void add_safl() {
// CHECK-NEXT: store float [[ADD]], float* @fl, align 4
// CHECK-NEXT: ret void
//
void add_flsa() {
void add_flsa(void) {
fl += sa;
}
@ -445,7 +445,7 @@ void add_flsa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void sub_auf() {
void sub_auf(void) {
a -= uf;
}
@ -461,7 +461,7 @@ void sub_auf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sub_ai() {
void sub_ai(void) {
a -= i;
}
@ -487,7 +487,7 @@ void sub_ai() {
// CHECK-NEXT: store i8 [[RESIZE3]], i8* @c, align 1
// CHECK-NEXT: ret void
//
void sub_csa() {
void sub_csa(void) {
c -= sa;
}
@ -503,7 +503,7 @@ void sub_csa() {
// CHECK-NEXT: store i32 [[TMP5]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sub_afl() {
void sub_afl(void) {
a -= fl;
}
@ -530,7 +530,7 @@ void sub_afl() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void mul_auf() {
void mul_auf(void) {
a *= uf;
}
@ -546,7 +546,7 @@ void mul_auf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void mul_ai() {
void mul_ai(void) {
a *= i;
}
@ -572,7 +572,7 @@ void mul_ai() {
// CHECK-NEXT: store i8 [[RESIZE3]], i8* @c, align 1
// CHECK-NEXT: ret void
//
void mul_csa() {
void mul_csa(void) {
c *= sa;
}
@ -588,7 +588,7 @@ void mul_csa() {
// CHECK-NEXT: store i32 [[TMP5]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void mul_afl() {
void mul_afl(void) {
a *= fl;
}
@ -615,7 +615,7 @@ void mul_afl() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void div_auf() {
void div_auf(void) {
a /= uf;
}
@ -631,7 +631,7 @@ void div_auf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void div_ai() {
void div_ai(void) {
a /= i;
}
@ -657,7 +657,7 @@ void div_ai() {
// CHECK-NEXT: store i8 [[RESIZE3]], i8* @c, align 1
// CHECK-NEXT: ret void
//
void div_csa() {
void div_csa(void) {
c /= sa;
}
@ -673,7 +673,7 @@ void div_csa() {
// CHECK-NEXT: store i32 [[TMP5]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void div_afl() {
void div_afl(void) {
a /= fl;
}
@ -686,7 +686,7 @@ void div_afl() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void shft_ai() {
void shft_ai(void) {
a <<= i;
}
@ -708,7 +708,7 @@ void shft_ai() {
// UNSIGNED-NEXT: store i16 [[TMP3]], i16* @suf, align 2
// UNSIGNED-NEXT: ret void
//
void shft_sufi() {
void shft_sufi(void) {
suf <<= i;
}
@ -721,6 +721,6 @@ void shft_sufi() {
// CHECK-NEXT: store i64 [[TMP3]], i64* @ula, align 8
// CHECK-NEXT: ret void
//
void shft_ulai() {
void shft_ulai(void) {
ula >>= i;
}

View File

@ -41,7 +41,7 @@ double d;
// CHECK-NEXT: store i32 [[TMP0]], i32* @a2, align 4
// CHECK-NEXT: ret void
//
void fix_same1() {
void fix_same1(void) {
a2 = a;
}
@ -51,7 +51,7 @@ void fix_same1() {
// CHECK-NEXT: store i32 [[TMP0]], i32* @a2, align 4
// CHECK-NEXT: ret void
//
void fix_same2() {
void fix_same2(void) {
a2 = (_Accum)a;
}
@ -64,7 +64,7 @@ void fix_same2() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_castdown1() {
void fix_castdown1(void) {
a = la;
}
@ -76,7 +76,7 @@ void fix_castdown1() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_castdown2() {
void fix_castdown2(void) {
a = (_Accum)la;
}
@ -88,7 +88,7 @@ void fix_castdown2() {
// CHECK-NEXT: store i16 [[RESIZE]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void fix_castdown3() {
void fix_castdown3(void) {
sa = a;
}
@ -100,7 +100,7 @@ void fix_castdown3() {
// CHECK-NEXT: store i16 [[RESIZE]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void fix_castdown4() {
void fix_castdown4(void) {
sa = a;
}
@ -113,7 +113,7 @@ void fix_castdown4() {
// CHECK-NEXT: store i32 [[UPSCALE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_castup1() {
void fix_castup1(void) {
a = sa;
}
@ -125,7 +125,7 @@ void fix_castup1() {
// CHECK-NEXT: store i32 [[UPSCALE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_castup2() {
void fix_castup2(void) {
a = (_Accum)sa;
}
@ -137,7 +137,7 @@ void fix_castup2() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_castup3() {
void fix_castup3(void) {
a = la;
}
@ -149,7 +149,7 @@ void fix_castup3() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_castup4() {
void fix_castup4(void) {
a = (long _Accum)la;
}
@ -167,7 +167,7 @@ void fix_castup4() {
// UNSIGNED-NEXT: store i32 [[TMP0]], i32* @ua, align 4
// UNSIGNED-NEXT: ret void
//
void fix_sign1() {
void fix_sign1(void) {
ua = a;
}
@ -184,7 +184,7 @@ void fix_sign1() {
// UNSIGNED-NEXT: store i32 [[TMP0]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void fix_sign2() {
void fix_sign2(void) {
a = ua;
}
@ -201,7 +201,7 @@ void fix_sign2() {
// UNSIGNED-NEXT: store i32 [[TMP0]], i32* @ua, align 4
// UNSIGNED-NEXT: ret void
//
void fix_sign3() {
void fix_sign3(void) {
ua = (unsigned _Accum)a;
}
@ -218,7 +218,7 @@ void fix_sign3() {
// UNSIGNED-NEXT: store i32 [[TMP0]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void fix_sign4() {
void fix_sign4(void) {
a = (_Accum)ua;
}
@ -238,7 +238,7 @@ void fix_sign4() {
// UNSIGNED-NEXT: store i64 [[UPSCALE]], i64* @ula, align 8
// UNSIGNED-NEXT: ret void
//
void fix_sign5() {
void fix_sign5(void) {
ula = a;
}
@ -255,7 +255,7 @@ void fix_sign5() {
// CHECK-NEXT: store i16 [[RESIZE]], i16* @sat_sa, align 2
// CHECK-NEXT: ret void
//
void fix_sat1() {
void fix_sat1(void) {
// Casting down between types
sat_sa = sat_a;
}
@ -272,7 +272,7 @@ void fix_sat1() {
// CHECK-NEXT: store i8 [[RESIZE]], i8* @sat_sf, align 1
// CHECK-NEXT: ret void
//
void fix_sat2() {
void fix_sat2(void) {
// Accum to Fract, decreasing scale
sat_sf = sat_a;
}
@ -288,7 +288,7 @@ void fix_sat2() {
// CHECK-NEXT: store i16 [[RESIZE]], i16* @sat_f, align 2
// CHECK-NEXT: ret void
//
void fix_sat3() {
void fix_sat3(void) {
// Accum to Fract, same scale
sat_f = a;
}
@ -306,7 +306,7 @@ void fix_sat3() {
// CHECK-NEXT: store i32 [[RESIZE1]], i32* @sat_lf, align 4
// CHECK-NEXT: ret void
//
void fix_sat4() {
void fix_sat4(void) {
// Accum to Fract, increasing scale
sat_lf = sat_a;
}
@ -335,7 +335,7 @@ void fix_sat4() {
// UNSIGNED-NEXT: store i16 [[RESIZE]], i16* @sat_usa, align 2
// UNSIGNED-NEXT: ret void
//
void fix_sat5() {
void fix_sat5(void) {
// Signed to unsigned, decreasing scale
sat_usa = sat_a;
}
@ -359,7 +359,7 @@ void fix_sat5() {
// UNSIGNED-NEXT: store i32 [[SATMIN]], i32* @sat_ua, align 4
// UNSIGNED-NEXT: ret void
//
void fix_sat6() {
void fix_sat6(void) {
// Signed to unsigned, increasing scale
sat_ua = sat_a;
}
@ -370,7 +370,7 @@ void fix_sat6() {
// CHECK-NEXT: store i32 [[TMP0]], i32* @sat_a, align 4
// CHECK-NEXT: ret void
//
void fix_sat7() {
void fix_sat7(void) {
// Nothing when saturating to the same type and size
sat_a = a;
}
@ -381,7 +381,7 @@ void fix_sat7() {
// CHECK-NEXT: store i32 [[TMP0]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_sat8() {
void fix_sat8(void) {
// Nothing when assigning back
a = sat_a;
}
@ -393,7 +393,7 @@ void fix_sat8() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @sat_a, align 4
// CHECK-NEXT: ret void
//
void fix_sat9() {
void fix_sat9(void) {
// No overflow when casting from fract to signed accum
sat_a = sat_f;
}
@ -418,7 +418,7 @@ void fix_sat9() {
// UNSIGNED-NEXT: store i32 [[SATMIN]], i32* @sat_ua, align 4
// UNSIGNED-NEXT: ret void
//
void fix_sat10() {
void fix_sat10(void) {
// Only get overflow checking if signed fract to unsigned accum
sat_ua = sat_sf;
}
@ -432,7 +432,7 @@ void fix_sat10() {
// CHECK-NEXT: store i8 [[RESIZE]], i8* @sf, align 1
// CHECK-NEXT: ret void
//
void fix_fract1() {
void fix_fract1(void) {
// To lower scale
sf = a;
}
@ -445,7 +445,7 @@ void fix_fract1() {
// CHECK-NEXT: store i32 [[UPSCALE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_fract2() {
void fix_fract2(void) {
// To higher scale
a = sf;
}
@ -457,7 +457,7 @@ void fix_fract2() {
// CHECK-NEXT: store i16 [[RESIZE]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void fix_fract3() {
void fix_fract3(void) {
// To same scale
f = a;
}
@ -469,7 +469,7 @@ void fix_fract3() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void fix_fract4() {
void fix_fract4(void) {
a = f;
}
@ -480,7 +480,7 @@ void fix_fract4() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @ua, align 4
// CHECK-NEXT: ret void
//
void fix_fract5() {
void fix_fract5(void) {
// To unsigned
ua = uf;
}
@ -492,7 +492,7 @@ void fix_fract5() {
// CHECK-NEXT: store i16 [[RESIZE]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void fix_fract6() {
void fix_fract6(void) {
uf = ua;
}
@ -508,7 +508,7 @@ void fix_fract6() {
// CHECK-NEXT: store i32 [[RESIZE]], i32* @i, align 4
// CHECK-NEXT: ret void
//
void fix_int1() {
void fix_int1(void) {
// Will need to check for negative values
i = sa;
}
@ -529,7 +529,7 @@ void fix_int1() {
// UNSIGNED-NEXT: store i32 [[RESIZE]], i32* @i, align 4
// UNSIGNED-NEXT: ret void
//
void fix_int2() {
void fix_int2(void) {
// No check needed for unsigned fixed points. Can just right shift.
i = usa;
}
@ -543,7 +543,7 @@ void fix_int2() {
// CHECK-NEXT: store i16 [[UPSCALE]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_fix1() {
void int_fix1(void) {
sa = i;
}
@ -555,7 +555,7 @@ void int_fix1() {
// CHECK-NEXT: store i16 [[UPSCALE]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_fix2() {
void int_fix2(void) {
sa = ui;
}
@ -575,7 +575,7 @@ void int_fix2() {
// UNSIGNED-NEXT: store i16 [[UPSCALE]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_fix3() {
void int_fix3(void) {
usa = i;
}
@ -595,7 +595,7 @@ void int_fix3() {
// UNSIGNED-NEXT: store i16 [[UPSCALE]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_fix4() {
void int_fix4(void) {
usa = ui;
}
@ -607,7 +607,7 @@ void int_fix4() {
// CHECK-NEXT: store i64 [[UPSCALE]], i64* @la, align 8
// CHECK-NEXT: ret void
//
void int_fix5() {
void int_fix5(void) {
la = s;
}
@ -625,7 +625,7 @@ void int_fix5() {
// CHECK-NEXT: store i16 [[RESIZE1]], i16* @sat_sa, align 2
// CHECK-NEXT: ret void
//
void int_sat1() {
void int_sat1(void) {
sat_sa = i;
}
@ -640,7 +640,7 @@ void int_sat1() {
// CHECK-NEXT: store i16 [[RESIZE1]], i16* @sat_sa, align 2
// CHECK-NEXT: ret void
//
void int_sat2() {
void int_sat2(void) {
sat_sa = ui;
}
@ -670,7 +670,7 @@ void int_sat2() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @sat_usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_sat3() {
void int_sat3(void) {
sat_usa = i;
}
@ -696,7 +696,7 @@ void int_sat3() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @sat_usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_sat4() {
void int_sat4(void) {
sat_usa = ui;
}
@ -709,7 +709,7 @@ void int_sat4() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void float_fix1() {
void float_fix1(void) {
sa = fl;
}
@ -721,7 +721,7 @@ void float_fix1() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void float_fix2() {
void float_fix2(void) {
a = fl;
}
@ -733,7 +733,7 @@ void float_fix2() {
// CHECK-NEXT: store i64 [[TMP2]], i64* @la, align 8
// CHECK-NEXT: ret void
//
void float_fix3() {
void float_fix3(void) {
la = fl;
}
@ -745,7 +745,7 @@ void float_fix3() {
// CHECK-NEXT: store i8 [[TMP2]], i8* @sf, align 1
// CHECK-NEXT: ret void
//
void float_fix4() {
void float_fix4(void) {
sf = fl;
}
@ -757,7 +757,7 @@ void float_fix4() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void float_fix5() {
void float_fix5(void) {
lf = fl;
}
@ -777,7 +777,7 @@ void float_fix5() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// UNSIGNED-NEXT: ret void
//
void float_fix6() {
void float_fix6(void) {
ua = fl;
}
@ -797,7 +797,7 @@ void float_fix6() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @uf, align 2
// UNSIGNED-NEXT: ret void
//
void float_fix7() {
void float_fix7(void) {
uf = fl;
}
@ -810,7 +810,7 @@ void float_fix7() {
// CHECK-NEXT: store float [[TMP2]], float* @fl, align 4
// CHECK-NEXT: ret void
//
void fix_float1() {
void fix_float1(void) {
fl = sa;
}
@ -822,7 +822,7 @@ void fix_float1() {
// CHECK-NEXT: store float [[TMP2]], float* @fl, align 4
// CHECK-NEXT: ret void
//
void fix_float2() {
void fix_float2(void) {
fl = a;
}
@ -834,7 +834,7 @@ void fix_float2() {
// CHECK-NEXT: store float [[TMP2]], float* @fl, align 4
// CHECK-NEXT: ret void
//
void fix_float3() {
void fix_float3(void) {
fl = la;
}
@ -846,7 +846,7 @@ void fix_float3() {
// CHECK-NEXT: store float [[TMP2]], float* @fl, align 4
// CHECK-NEXT: ret void
//
void fix_float4() {
void fix_float4(void) {
fl = sf;
}
@ -858,7 +858,7 @@ void fix_float4() {
// CHECK-NEXT: store float [[TMP2]], float* @fl, align 4
// CHECK-NEXT: ret void
//
void fix_float5() {
void fix_float5(void) {
fl = lf;
}
@ -878,7 +878,7 @@ void fix_float5() {
// UNSIGNED-NEXT: store float [[TMP2]], float* @fl, align 4
// UNSIGNED-NEXT: ret void
//
void fix_float6() {
void fix_float6(void) {
fl = ua;
}
@ -898,7 +898,7 @@ void fix_float6() {
// UNSIGNED-NEXT: store float [[TMP2]], float* @fl, align 4
// UNSIGNED-NEXT: ret void
//
void fix_float7() {
void fix_float7(void) {
fl = uf;
}
@ -911,7 +911,7 @@ void fix_float7() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sat_sa, align 2
// CHECK-NEXT: ret void
//
void float_sat1() {
void float_sat1(void) {
sat_sa = fl;
}
@ -923,7 +923,7 @@ void float_sat1() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @sat_a, align 4
// CHECK-NEXT: ret void
//
void float_sat2() {
void float_sat2(void) {
sat_a = fl;
}
@ -935,7 +935,7 @@ void float_sat2() {
// CHECK-NEXT: store i64 [[TMP2]], i64* @sat_la, align 8
// CHECK-NEXT: ret void
//
void float_sat3() {
void float_sat3(void) {
sat_la = fl;
}
@ -947,7 +947,7 @@ void float_sat3() {
// CHECK-NEXT: store i8 [[TMP2]], i8* @sat_sf, align 1
// CHECK-NEXT: ret void
//
void float_sat4() {
void float_sat4(void) {
sat_sf = fl;
}
@ -969,7 +969,7 @@ void float_sat4() {
// UNSIGNED-NEXT: store i32 [[SATMIN]], i32* @sat_ua, align 4
// UNSIGNED-NEXT: ret void
//
void float_sat5() {
void float_sat5(void) {
sat_ua = fl;
}
@ -991,6 +991,6 @@ void float_sat5() {
// UNSIGNED-NEXT: store i16 [[SATMIN]], i16* @sat_uf, align 2
// UNSIGNED-NEXT: ret void
//
void float_sat6() {
void float_sat6(void) {
sat_uf = fl;
}

View File

@ -31,7 +31,7 @@ _Float16 h;
// CHECK-NEXT: store i8 [[TMP2]], i8* @sf, align 1
// CHECK-NEXT: ret void
//
void half_fix1() {
void half_fix1(void) {
sf = h;
}
@ -44,7 +44,7 @@ void half_fix1() {
// CHECK-NEXT: store i32 [[TMP3]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void half_fix2() {
void half_fix2(void) {
lf = h;
}
@ -56,7 +56,7 @@ void half_fix2() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void half_fix3() {
void half_fix3(void) {
sa = h;
}
@ -69,7 +69,7 @@ void half_fix3() {
// CHECK-NEXT: store i64 [[TMP3]], i64* @la, align 8
// CHECK-NEXT: ret void
//
void half_fix4() {
void half_fix4(void) {
la = h;
}
@ -90,7 +90,7 @@ void half_fix4() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void half_fix5() {
void half_fix5(void) {
usa = h;
}
@ -112,7 +112,7 @@ void half_fix5() {
// UNSIGNED-NEXT: store i64 [[TMP3]], i64* @ula, align 8
// UNSIGNED-NEXT: ret void
//
void half_fix6() {
void half_fix6(void) {
ula = h;
}
@ -125,7 +125,7 @@ void half_fix6() {
// CHECK-NEXT: store i8 [[TMP2]], i8* @sf_sat, align 1
// CHECK-NEXT: ret void
//
void half_sat1() {
void half_sat1(void) {
sf_sat = h;
}
@ -138,7 +138,7 @@ void half_sat1() {
// CHECK-NEXT: store i32 [[TMP3]], i32* @lf_sat, align 4
// CHECK-NEXT: ret void
//
void half_sat2() {
void half_sat2(void) {
lf_sat = h;
}
@ -150,7 +150,7 @@ void half_sat2() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void half_sat3() {
void half_sat3(void) {
sa_sat = h;
}
@ -163,7 +163,7 @@ void half_sat3() {
// CHECK-NEXT: store i64 [[TMP3]], i64* @la_sat, align 8
// CHECK-NEXT: ret void
//
void half_sat4() {
void half_sat4(void) {
la_sat = h;
}
@ -186,7 +186,7 @@ void half_sat4() {
// UNSIGNED-NEXT: store i16 [[SATMIN]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void half_sat5() {
void half_sat5(void) {
usa_sat = h;
}
@ -210,7 +210,7 @@ void half_sat5() {
// UNSIGNED-NEXT: store i64 [[SATMIN]], i64* @ula_sat, align 8
// UNSIGNED-NEXT: ret void
//
void half_sat6() {
void half_sat6(void) {
ula_sat = h;
}
@ -223,7 +223,7 @@ void half_sat6() {
// CHECK-NEXT: store half [[TMP2]], half* @h, align 2
// CHECK-NEXT: ret void
//
void fix_half1() {
void fix_half1(void) {
h = sf;
}
@ -236,7 +236,7 @@ void fix_half1() {
// CHECK-NEXT: store half [[TMP3]], half* @h, align 2
// CHECK-NEXT: ret void
//
void fix_half2() {
void fix_half2(void) {
h = lf;
}
@ -248,7 +248,7 @@ void fix_half2() {
// CHECK-NEXT: store half [[TMP2]], half* @h, align 2
// CHECK-NEXT: ret void
//
void fix_half3() {
void fix_half3(void) {
h = sa;
}
@ -261,7 +261,7 @@ void fix_half3() {
// CHECK-NEXT: store half [[TMP3]], half* @h, align 2
// CHECK-NEXT: ret void
//
void fix_half4() {
void fix_half4(void) {
h = la;
}
@ -282,7 +282,7 @@ void fix_half4() {
// UNSIGNED-NEXT: store half [[TMP2]], half* @h, align 2
// UNSIGNED-NEXT: ret void
//
void fix_half5() {
void fix_half5(void) {
h = usa;
}
@ -304,6 +304,6 @@ void fix_half5() {
// UNSIGNED-NEXT: store half [[TMP3]], half* @h, align 2
// UNSIGNED-NEXT: ret void
//
void fix_half6() {
void fix_half6(void) {
h = ula;
}

View File

@ -5,13 +5,13 @@ union a {
int i;
};
int fn1() {
int fn1(void) {
union a m;
m.x = 5.6k;
return m.i;
}
int fn2() {
int fn2(void) {
union a m;
m.x = 7, 5.6k; // expected-warning {{expression result unused}}
return m.x, m.i; // expected-warning {{left operand of comma operator has no effect}}

View File

@ -36,7 +36,7 @@ _Bool b;
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sdiv_sasasa() {
void sdiv_sasasa(void) {
sa = sa / sa;
}
@ -50,7 +50,7 @@ void sdiv_sasasa() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sdiv_asaa() {
void sdiv_asaa(void) {
a = sa / a;
}
@ -63,7 +63,7 @@ void sdiv_asaa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sdiv_sasasf() {
void sdiv_sasasf(void) {
sa = sa / sf;
}
@ -80,7 +80,7 @@ void sdiv_sasasf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sdiv_sasaf() {
void sdiv_sasaf(void) {
sa = sa / f;
}
@ -94,7 +94,7 @@ void sdiv_sasaf() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sdiv_aasf() {
void sdiv_aasf(void) {
a = a / sf;
}
@ -111,7 +111,7 @@ void sdiv_aasf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sdiv_aalf() {
void sdiv_aalf(void) {
a = a / lf;
}
@ -136,7 +136,7 @@ void sdiv_aalf() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void sdiv_sasausa() {
void sdiv_sasausa(void) {
sa = sa / usa;
}
@ -163,7 +163,7 @@ void sdiv_sasausa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void sdiv_asaua() {
void sdiv_asaua(void) {
a = sa / ua;
}
@ -189,7 +189,7 @@ void sdiv_asaua() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void sdiv_sasausf() {
void sdiv_sasausf(void) {
sa = sa / usf;
}
@ -219,7 +219,7 @@ void sdiv_sasausf() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void sdiv_sasaulf() {
void sdiv_sasaulf(void) {
sa = sa / ulf;
}
@ -235,7 +235,7 @@ void sdiv_sasaulf() {
// CHECK-NEXT: store i32 [[TMP6]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sdiv_aaaaa() {
void sdiv_aaaaa(void) {
a = a / a2 / a3 / a4;
}
@ -256,7 +256,7 @@ void sdiv_aaaaa() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void udiv_usausausa() {
void udiv_usausausa(void) {
usa = usa / usa;
}
@ -280,7 +280,7 @@ void udiv_usausausa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// UNSIGNED-NEXT: ret void
//
void udiv_uausaua() {
void udiv_uausaua(void) {
ua = usa / ua;
}
@ -302,7 +302,7 @@ void udiv_uausaua() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void udiv_usausausf() {
void udiv_usausausf(void) {
usa = usa / usf;
}
@ -332,7 +332,7 @@ void udiv_usausausf() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void udiv_usausauf() {
void udiv_usausauf(void) {
usa = usa / uf;
}
@ -349,7 +349,7 @@ void udiv_usausauf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasai() {
void int_sasai(void) {
sa = sa / i;
}
@ -365,7 +365,7 @@ void int_sasai() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasaui() {
void int_sasaui(void) {
sa = sa / ui;
}
@ -393,7 +393,7 @@ void int_sasaui() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausai() {
void int_usausai(void) {
usa = usa / i;
}
@ -421,7 +421,7 @@ void int_usausai() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausaui() {
void int_usausaui(void) {
usa = usa / ui;
}
@ -437,7 +437,7 @@ void int_usausaui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void int_lflfui() {
void int_lflfui(void) {
lf = lf / ui;
}
@ -455,7 +455,7 @@ void int_lflfui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void int_aab() {
void int_aab(void) {
a = a / b;
}
@ -471,7 +471,7 @@ void int_aab() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void int_aia() {
void int_aia(void) {
a = i / a;
}
@ -499,7 +499,7 @@ void int_aia() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usauiusa() {
void int_usauiusa(void) {
usa = ui / usa;
}
@ -515,7 +515,7 @@ void int_usauiusa() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sauisa() {
void int_sauisa(void) {
sa = ui / sa;
}
@ -528,7 +528,7 @@ void int_sauisa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasas() {
void sat_sassasas(void) {
sa_sat = sa / sa_sat;
}
@ -550,7 +550,7 @@ void sat_sassasas() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusausas() {
void sat_usasusausas(void) {
usa_sat = usa / usa_sat;
}
@ -576,7 +576,7 @@ void sat_usasusausas() {
// UNSIGNED-NEXT: store i32 [[RESIZE2]], i32* @ua_sat, align 4
// UNSIGNED-NEXT: ret void
//
void sat_uasuausas() {
void sat_uasuausas(void) {
ua_sat = ua / usa_sat;
}
@ -596,7 +596,7 @@ void sat_uasuausas() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasi() {
void sat_sassasi(void) {
sa_sat = sa_sat / i;
}
@ -616,7 +616,7 @@ void sat_sassasi() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasui() {
void sat_sassasui(void) {
sa_sat = sa_sat / ui;
}
@ -638,7 +638,7 @@ void sat_sassasui() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @uf_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_ufsufsufs() {
void sat_ufsufsufs(void) {
uf_sat = uf_sat / uf_sat;
}
@ -674,6 +674,6 @@ void sat_ufsufsufs() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusasi() {
void sat_usasusasi(void) {
usa_sat = usa_sat / i;
}

View File

@ -149,7 +149,7 @@ _Accum dec_with_hex_exp2 = 0.1P10k; // expected-error{{invalid suffix 'P10k'
_Accum hex_with_dex_exp1 = 0x0.1e10k; // expected-error{{hexadecimal floating constant requires an exponent}}
_Accum hex_with_dex_exp2 = 0x0.1E10k; // expected-error{{hexadecimal floating constant requires an exponent}}
void CheckSuffixOnIntegerLiterals() {
void CheckSuffixOnIntegerLiterals(void) {
_Accum short_acc_int;
_Accum acc_int;
_Accum long_acc_int;

View File

@ -36,7 +36,7 @@ _Bool b;
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void smul_sasasa() {
void smul_sasasa(void) {
sa = sa * sa;
}
@ -50,7 +50,7 @@ void smul_sasasa() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void smul_asaa() {
void smul_asaa(void) {
a = sa * a;
}
@ -63,7 +63,7 @@ void smul_asaa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void smul_sasasf() {
void smul_sasasf(void) {
sa = sa * sf;
}
@ -80,7 +80,7 @@ void smul_sasasf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void smul_sasaf() {
void smul_sasaf(void) {
sa = sa * f;
}
@ -94,7 +94,7 @@ void smul_sasaf() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void smul_aasf() {
void smul_aasf(void) {
a = a * sf;
}
@ -111,7 +111,7 @@ void smul_aasf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void smul_aalf() {
void smul_aalf(void) {
a = a * lf;
}
@ -136,7 +136,7 @@ void smul_aalf() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void smul_sasausa() {
void smul_sasausa(void) {
sa = sa * usa;
}
@ -163,7 +163,7 @@ void smul_sasausa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void smul_asaua() {
void smul_asaua(void) {
a = sa * ua;
}
@ -189,7 +189,7 @@ void smul_asaua() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void smul_sasausf() {
void smul_sasausf(void) {
sa = sa * usf;
}
@ -219,7 +219,7 @@ void smul_sasausf() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void smul_sasaulf() {
void smul_sasaulf(void) {
sa = sa * ulf;
}
@ -235,7 +235,7 @@ void smul_sasaulf() {
// CHECK-NEXT: store i32 [[TMP6]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void smul_aaaaa() {
void smul_aaaaa(void) {
a = a * a2 * a3 * a4;
}
@ -256,7 +256,7 @@ void smul_aaaaa() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void umul_usausausa() {
void umul_usausausa(void) {
usa = usa * usa;
}
@ -280,7 +280,7 @@ void umul_usausausa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// UNSIGNED-NEXT: ret void
//
void umul_uausaua() {
void umul_uausaua(void) {
ua = usa * ua;
}
@ -302,7 +302,7 @@ void umul_uausaua() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void umul_usausausf() {
void umul_usausausf(void) {
usa = usa * usf;
}
@ -332,7 +332,7 @@ void umul_usausausf() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void umul_usausauf() {
void umul_usausauf(void) {
usa = usa * uf;
}
@ -349,7 +349,7 @@ void umul_usausauf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasai() {
void int_sasai(void) {
sa = sa * i;
}
@ -365,7 +365,7 @@ void int_sasai() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasaui() {
void int_sasaui(void) {
sa = sa * ui;
}
@ -393,7 +393,7 @@ void int_sasaui() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausai() {
void int_usausai(void) {
usa = usa * i;
}
@ -421,7 +421,7 @@ void int_usausai() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausaui() {
void int_usausaui(void) {
usa = usa * ui;
}
@ -437,7 +437,7 @@ void int_usausaui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void int_lflfui() {
void int_lflfui(void) {
lf = lf * ui;
}
@ -455,7 +455,7 @@ void int_lflfui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void int_aab() {
void int_aab(void) {
a = a * b;
}
@ -471,7 +471,7 @@ void int_aab() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void int_aia() {
void int_aia(void) {
a = i * a;
}
@ -499,7 +499,7 @@ void int_aia() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usauiusa() {
void int_usauiusa(void) {
usa = ui * usa;
}
@ -515,7 +515,7 @@ void int_usauiusa() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sauisa() {
void int_sauisa(void) {
sa = ui * sa;
}
@ -528,7 +528,7 @@ void int_sauisa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasas() {
void sat_sassasas(void) {
sa_sat = sa * sa_sat;
}
@ -550,7 +550,7 @@ void sat_sassasas() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusausas() {
void sat_usasusausas(void) {
usa_sat = usa * usa_sat;
}
@ -576,7 +576,7 @@ void sat_usasusausas() {
// UNSIGNED-NEXT: store i32 [[RESIZE2]], i32* @ua_sat, align 4
// UNSIGNED-NEXT: ret void
//
void sat_uasuausas() {
void sat_uasuausas(void) {
ua_sat = ua * usa_sat;
}
@ -596,7 +596,7 @@ void sat_uasuausas() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasi() {
void sat_sassasi(void) {
sa_sat = sa_sat * i;
}
@ -616,7 +616,7 @@ void sat_sassasi() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasui() {
void sat_sassasui(void) {
sa_sat = sa_sat * ui;
}
@ -638,7 +638,7 @@ void sat_sassasui() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @uf_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_ufsufsufs() {
void sat_ufsufsufs(void) {
uf_sat = uf_sat * uf_sat;
}
@ -674,6 +674,6 @@ void sat_ufsufsufs() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusasi() {
void sat_usasusasi(void) {
usa_sat = usa_sat * i;
}

View File

@ -4,7 +4,7 @@
/* The scale for unsigned fixed point types should be the same as that of signed
* fixed point types when -fsame-fbits is enabled. */
void func() {
void func(void) {
unsigned short _Accum u_short_accum = 0.5uhk;
unsigned _Accum u_accum = 0.5uk;
unsigned long _Accum u_long_accum = 0.5ulk;

View File

@ -43,7 +43,7 @@ unsigned u;
// CHECK-NEXT: store i16 [[TMP3]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sleft_sasai() {
void sleft_sasai(void) {
sa = sa << i;
}
@ -55,7 +55,7 @@ void sleft_sasai() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sleft_aai() {
void sleft_aai(void) {
a = a << i;
}
@ -68,7 +68,7 @@ void sleft_aai() {
// CHECK-NEXT: store i64 [[TMP3]], i64* @la, align 8
// CHECK-NEXT: ret void
//
void sleft_lalai() {
void sleft_lalai(void) {
la = la << i;
}
@ -81,7 +81,7 @@ void sleft_lalai() {
// CHECK-NEXT: store i8 [[TMP3]], i8* @sf, align 1
// CHECK-NEXT: ret void
//
void sleft_sfsfi() {
void sleft_sfsfi(void) {
sf = sf << i;
}
@ -94,7 +94,7 @@ void sleft_sfsfi() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void sleft_ffi() {
void sleft_ffi(void) {
f = f << i;
}
@ -106,7 +106,7 @@ void sleft_ffi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void sleft_lflfi() {
void sleft_lflfi(void) {
lf = lf << i;
}
@ -118,7 +118,7 @@ void sleft_lflfi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sleft_aau() {
void sleft_aau(void) {
a = a << u;
}
@ -131,7 +131,7 @@ void sleft_aau() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void sleft_ffu() {
void sleft_ffu(void) {
f = f << u;
}
@ -145,7 +145,7 @@ void sleft_ffu() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void uleft_usausai() {
void uleft_usausai(void) {
usa = usa << i;
}
@ -157,7 +157,7 @@ void uleft_usausai() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// CHECK-NEXT: ret void
//
void uleft_uauai() {
void uleft_uauai(void) {
ua = ua << i;
}
@ -170,7 +170,7 @@ void uleft_uauai() {
// CHECK-NEXT: store i64 [[TMP3]], i64* @ula, align 8
// CHECK-NEXT: ret void
//
void uleft_ulaulai() {
void uleft_ulaulai(void) {
ula = ula << i;
}
@ -183,7 +183,7 @@ void uleft_ulaulai() {
// CHECK-NEXT: store i8 [[TMP3]], i8* @usf, align 1
// CHECK-NEXT: ret void
//
void uleft_usfusfi() {
void uleft_usfusfi(void) {
usf = usf << i;
}
@ -196,7 +196,7 @@ void uleft_usfusfi() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void uleft_ufufi() {
void uleft_ufufi(void) {
uf = uf << i;
}
@ -208,7 +208,7 @@ void uleft_ufufi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ulf, align 4
// CHECK-NEXT: ret void
//
void uleft_ulfulfi() {
void uleft_ulfulfi(void) {
ulf = ulf << i;
}
@ -220,7 +220,7 @@ void uleft_ulfulfi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// CHECK-NEXT: ret void
//
void uleft_uauau() {
void uleft_uauau(void) {
ua = ua << u;
}
@ -233,7 +233,7 @@ void uleft_uauau() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void uleft_ufufu() {
void uleft_ufufu(void) {
uf = uf << u;
}
@ -247,7 +247,7 @@ void uleft_ufufu() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void sright_sasai() {
void sright_sasai(void) {
sa = sa >> i;
}
@ -259,7 +259,7 @@ void sright_sasai() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sright_aai() {
void sright_aai(void) {
a = a >> i;
}
@ -272,7 +272,7 @@ void sright_aai() {
// CHECK-NEXT: store i64 [[TMP3]], i64* @la, align 8
// CHECK-NEXT: ret void
//
void sright_lalai() {
void sright_lalai(void) {
la = la >> i;
}
@ -285,7 +285,7 @@ void sright_lalai() {
// CHECK-NEXT: store i8 [[TMP3]], i8* @sf, align 1
// CHECK-NEXT: ret void
//
void sright_sfsfi() {
void sright_sfsfi(void) {
sf = sf >> i;
}
@ -298,7 +298,7 @@ void sright_sfsfi() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void sright_ffi() {
void sright_ffi(void) {
f = f >> i;
}
@ -310,7 +310,7 @@ void sright_ffi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void sright_lflfi() {
void sright_lflfi(void) {
lf = lf >> i;
}
@ -322,7 +322,7 @@ void sright_lflfi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void sright_aau() {
void sright_aau(void) {
a = a >> u;
}
@ -335,7 +335,7 @@ void sright_aau() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void sright_ffu() {
void sright_ffu(void) {
f = f >> u;
}
@ -349,7 +349,7 @@ void sright_ffu() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void uright_usausai() {
void uright_usausai(void) {
usa = usa >> i;
}
@ -361,7 +361,7 @@ void uright_usausai() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// CHECK-NEXT: ret void
//
void uright_uauai() {
void uright_uauai(void) {
ua = ua >> i;
}
@ -374,7 +374,7 @@ void uright_uauai() {
// CHECK-NEXT: store i64 [[TMP3]], i64* @ula, align 8
// CHECK-NEXT: ret void
//
void uright_ulaulai() {
void uright_ulaulai(void) {
ula = ula >> i;
}
@ -387,7 +387,7 @@ void uright_ulaulai() {
// CHECK-NEXT: store i8 [[TMP3]], i8* @usf, align 1
// CHECK-NEXT: ret void
//
void uright_usfusfi() {
void uright_usfusfi(void) {
usf = usf >> i;
}
@ -400,7 +400,7 @@ void uright_usfusfi() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void uright_ufufi() {
void uright_ufufi(void) {
uf = uf >> i;
}
@ -412,7 +412,7 @@ void uright_ufufi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ulf, align 4
// CHECK-NEXT: ret void
//
void uright_ulfulfi() {
void uright_ulfulfi(void) {
ulf = ulf >> i;
}
@ -424,7 +424,7 @@ void uright_ulfulfi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// CHECK-NEXT: ret void
//
void uright_uauau() {
void uright_uauau(void) {
ua = ua >> u;
}
@ -437,7 +437,7 @@ void uright_uauau() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void uright_ufufu() {
void uright_ufufu(void) {
uf = uf >> u;
}
@ -451,7 +451,7 @@ void uright_ufufu() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void satleft_sassasi() {
void satleft_sassasi(void) {
sa_sat = sa_sat << i;
}
@ -463,7 +463,7 @@ void satleft_sassasi() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a_sat, align 4
// CHECK-NEXT: ret void
//
void satleft_asasi() {
void satleft_asasi(void) {
a_sat = a_sat << i;
}
@ -476,7 +476,7 @@ void satleft_asasi() {
// CHECK-NEXT: store i8 [[TMP3]], i8* @sf_sat, align 1
// CHECK-NEXT: ret void
//
void satleft_sfssfsi() {
void satleft_sfssfsi(void) {
sf_sat = sf_sat << i;
}
@ -489,7 +489,7 @@ void satleft_sfssfsi() {
// CHECK-NEXT: store i16 [[TMP3]], i16* @f_sat, align 2
// CHECK-NEXT: ret void
//
void satleft_fsfsi() {
void satleft_fsfsi(void) {
f_sat = f_sat << i;
}
@ -511,7 +511,7 @@ void satleft_fsfsi() {
// UNSIGNED-NEXT: store i16 [[TMP3]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void satleft_usasusasi() {
void satleft_usasusasi(void) {
usa_sat = usa_sat << i;
}
@ -531,7 +531,7 @@ void satleft_usasusasi() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @ua_sat, align 4
// UNSIGNED-NEXT: ret void
//
void satleft_uasuasi() {
void satleft_uasuasi(void) {
ua_sat = ua_sat << i;
}
@ -553,7 +553,7 @@ void satleft_uasuasi() {
// UNSIGNED-NEXT: store i8 [[TMP3]], i8* @usf_sat, align 1
// UNSIGNED-NEXT: ret void
//
void satleft_usfsusfsi() {
void satleft_usfsusfsi(void) {
usf_sat = usf_sat << i;
}
@ -575,6 +575,6 @@ void satleft_usfsusfsi() {
// UNSIGNED-NEXT: store i16 [[TMP3]], i16* @uf_sat, align 2
// UNSIGNED-NEXT: ret void
//
void satleft_ufsufsi() {
void satleft_ufsufsi(void) {
uf_sat = uf_sat << i;
}

View File

@ -36,7 +36,7 @@ _Bool b;
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void ssub_sasasa() {
void ssub_sasasa(void) {
sa = sa - sa;
}
@ -50,7 +50,7 @@ void ssub_sasasa() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void ssub_asaa() {
void ssub_asaa(void) {
a = sa - a;
}
@ -63,7 +63,7 @@ void ssub_asaa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void ssub_sasasf() {
void ssub_sasasf(void) {
sa = sa - sf;
}
@ -80,7 +80,7 @@ void ssub_sasasf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void ssub_sasaf() {
void ssub_sasaf(void) {
sa = sa - f;
}
@ -94,7 +94,7 @@ void ssub_sasaf() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void ssub_aasf() {
void ssub_aasf(void) {
a = a - sf;
}
@ -111,7 +111,7 @@ void ssub_aasf() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void ssub_aalf() {
void ssub_aalf(void) {
a = a - lf;
}
@ -136,7 +136,7 @@ void ssub_aalf() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void ssub_sasausa() {
void ssub_sasausa(void) {
sa = sa - usa;
}
@ -163,7 +163,7 @@ void ssub_sasausa() {
// UNSIGNED-NEXT: store i32 [[TMP2]], i32* @a, align 4
// UNSIGNED-NEXT: ret void
//
void ssub_asaua() {
void ssub_asaua(void) {
a = sa - ua;
}
@ -189,7 +189,7 @@ void ssub_asaua() {
// UNSIGNED-NEXT: store i16 [[TMP2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void ssub_sasausf() {
void ssub_sasausf(void) {
sa = sa - usf;
}
@ -219,7 +219,7 @@ void ssub_sasausf() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// UNSIGNED-NEXT: ret void
//
void ssub_sasaulf() {
void ssub_sasaulf(void) {
sa = sa - ulf;
}
@ -235,7 +235,7 @@ void ssub_sasaulf() {
// CHECK-NEXT: store i32 [[TMP6]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void ssub_aaaaa() {
void ssub_aaaaa(void) {
a = a - a2 - a3 - a4;
}
@ -248,7 +248,7 @@ void ssub_aaaaa() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void usub_usausausa() {
void usub_usausausa(void) {
usa = usa - usa;
}
@ -262,7 +262,7 @@ void usub_usausausa() {
// CHECK-NEXT: store i32 [[TMP2]], i32* @ua, align 4
// CHECK-NEXT: ret void
//
void usub_uausaua() {
void usub_uausaua(void) {
ua = usa - ua;
}
@ -275,7 +275,7 @@ void usub_uausaua() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void usub_usausausf() {
void usub_usausausf(void) {
usa = usa - usf;
}
@ -292,7 +292,7 @@ void usub_usausausf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void usub_usausauf() {
void usub_usausauf(void) {
usa = usa - uf;
}
@ -309,7 +309,7 @@ void usub_usausauf() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasai() {
void int_sasai(void) {
sa = sa - i;
}
@ -325,7 +325,7 @@ void int_sasai() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa, align 2
// CHECK-NEXT: ret void
//
void int_sasaui() {
void int_sasaui(void) {
sa = sa - ui;
}
@ -353,7 +353,7 @@ void int_sasaui() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausai() {
void int_usausai(void) {
usa = usa - i;
}
@ -381,7 +381,7 @@ void int_usausai() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void int_usausaui() {
void int_usausaui(void) {
usa = usa - ui;
}
@ -397,7 +397,7 @@ void int_usausaui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void int_lflfui() {
void int_lflfui(void) {
lf = lf - ui;
}
@ -415,7 +415,7 @@ void int_lflfui() {
// CHECK-NEXT: store i32 [[RESIZE2]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void int_aab() {
void int_aab(void) {
a = a - b;
}
@ -428,7 +428,7 @@ void int_aab() {
// CHECK-NEXT: store i16 [[TMP2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasas() {
void sat_sassasas(void) {
sa_sat = sa - sa_sat;
}
@ -452,7 +452,7 @@ void sat_sassasas() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusausas() {
void sat_usasusausas(void) {
usa_sat = usa - usa_sat;
}
@ -480,7 +480,7 @@ void sat_usasusausas() {
// UNSIGNED-NEXT: store i32 [[RESIZE2]], i32* @ua_sat, align 4
// UNSIGNED-NEXT: ret void
//
void sat_uasuausas() {
void sat_uasuausas(void) {
ua_sat = ua - usa_sat;
}
@ -500,7 +500,7 @@ void sat_uasuausas() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasi() {
void sat_sassasi(void) {
sa_sat = sa_sat - i;
}
@ -520,7 +520,7 @@ void sat_sassasi() {
// CHECK-NEXT: store i16 [[RESIZE2]], i16* @sa_sat, align 2
// CHECK-NEXT: ret void
//
void sat_sassasui() {
void sat_sassasui(void) {
sa_sat = sa_sat - ui;
}
@ -544,7 +544,7 @@ void sat_sassasui() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @uf_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_ufsufsufs() {
void sat_ufsufsufs(void) {
uf_sat = uf_sat - uf_sat;
}
@ -580,6 +580,6 @@ void sat_ufsufsufs() {
// UNSIGNED-NEXT: store i16 [[RESIZE2]], i16* @usa_sat, align 2
// UNSIGNED-NEXT: ret void
//
void sat_usasusasi() {
void sat_usasusasi(void) {
usa_sat = usa_sat - i;
}

View File

@ -4,7 +4,7 @@
_Bool global_b = 1.0k; // @global_b = {{*.}}global i8 1, align 1
_Bool global_b2 = 0.0k; // @global_b2 = {{*.}}global i8 0, align 1
void func() {
void func(void) {
_Accum a = 0.5k;
unsigned _Accum ua = 0.5uk;
_Bool b;

View File

@ -25,7 +25,7 @@ int i;
// CHECK-NEXT: store i32 [[TMP1]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void inc_a() {
void inc_a(void) {
a++;
}
@ -36,7 +36,7 @@ void inc_a() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void inc_f() {
void inc_f(void) {
f++;
}
@ -47,7 +47,7 @@ void inc_f() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void inc_lf() {
void inc_lf(void) {
lf++;
}
@ -65,7 +65,7 @@ void inc_lf() {
// UNSIGNED-NEXT: store i32 [[TMP1]], i32* @ua, align 4
// UNSIGNED-NEXT: ret void
//
void inc_ua() {
void inc_ua(void) {
ua++;
}
@ -83,7 +83,7 @@ void inc_ua() {
// UNSIGNED-NEXT: store i16 [[TMP1]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void inc_usa() {
void inc_usa(void) {
usa++;
}
@ -101,7 +101,7 @@ void inc_usa() {
// UNSIGNED-NEXT: store i16 [[TMP1]], i16* @uf, align 2
// UNSIGNED-NEXT: ret void
//
void inc_uf() {
void inc_uf(void) {
uf++;
}
@ -112,7 +112,7 @@ void inc_uf() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @sa, align 4
// CHECK-NEXT: ret void
//
void inc_sa() {
void inc_sa(void) {
sa++;
}
@ -123,7 +123,7 @@ void inc_sa() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @sf, align 2
// CHECK-NEXT: ret void
//
void inc_sf() {
void inc_sf(void) {
sf++;
}
@ -134,7 +134,7 @@ void inc_sf() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @slf, align 4
// CHECK-NEXT: ret void
//
void inc_slf() {
void inc_slf(void) {
slf++;
}
@ -154,7 +154,7 @@ void inc_slf() {
// UNSIGNED-NEXT: store i32 [[RESIZE1]], i32* @sua, align 4
// UNSIGNED-NEXT: ret void
//
void inc_sua() {
void inc_sua(void) {
sua++;
}
@ -174,7 +174,7 @@ void inc_sua() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @susa, align 2
// UNSIGNED-NEXT: ret void
//
void inc_susa() {
void inc_susa(void) {
susa++;
}
@ -194,7 +194,7 @@ void inc_susa() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @suf, align 2
// UNSIGNED-NEXT: ret void
//
void inc_suf() {
void inc_suf(void) {
suf++;
}
@ -206,7 +206,7 @@ void inc_suf() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void dec_a() {
void dec_a(void) {
a--;
}
@ -217,7 +217,7 @@ void dec_a() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void dec_f() {
void dec_f(void) {
f--;
}
@ -228,7 +228,7 @@ void dec_f() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @lf, align 4
// CHECK-NEXT: ret void
//
void dec_lf() {
void dec_lf(void) {
lf--;
}
@ -246,7 +246,7 @@ void dec_lf() {
// UNSIGNED-NEXT: store i32 [[TMP1]], i32* @ua, align 4
// UNSIGNED-NEXT: ret void
//
void dec_ua() {
void dec_ua(void) {
ua--;
}
@ -264,7 +264,7 @@ void dec_ua() {
// UNSIGNED-NEXT: store i16 [[TMP1]], i16* @usa, align 2
// UNSIGNED-NEXT: ret void
//
void dec_usa() {
void dec_usa(void) {
usa--;
}
@ -282,7 +282,7 @@ void dec_usa() {
// UNSIGNED-NEXT: store i16 [[TMP1]], i16* @uf, align 2
// UNSIGNED-NEXT: ret void
//
void dec_uf() {
void dec_uf(void) {
uf--;
}
@ -293,7 +293,7 @@ void dec_uf() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @sa, align 4
// CHECK-NEXT: ret void
//
void dec_sa() {
void dec_sa(void) {
sa--;
}
@ -304,7 +304,7 @@ void dec_sa() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @sf, align 2
// CHECK-NEXT: ret void
//
void dec_sf() {
void dec_sf(void) {
sf--;
}
@ -315,7 +315,7 @@ void dec_sf() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @slf, align 4
// CHECK-NEXT: ret void
//
void dec_slf() {
void dec_slf(void) {
slf--;
}
@ -337,7 +337,7 @@ void dec_slf() {
// UNSIGNED-NEXT: store i32 [[RESIZE1]], i32* @sua, align 4
// UNSIGNED-NEXT: ret void
//
void dec_sua() {
void dec_sua(void) {
sua--;
}
@ -359,7 +359,7 @@ void dec_sua() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @susa, align 2
// UNSIGNED-NEXT: ret void
//
void dec_susa() {
void dec_susa(void) {
susa--;
}
@ -381,7 +381,7 @@ void dec_susa() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @suf, align 2
// UNSIGNED-NEXT: ret void
//
void dec_suf() {
void dec_suf(void) {
suf--;
}
@ -393,7 +393,7 @@ void dec_suf() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void neg_a() {
void neg_a(void) {
a = -a;
}
@ -404,7 +404,7 @@ void neg_a() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @f, align 2
// CHECK-NEXT: ret void
//
void neg_f() {
void neg_f(void) {
f = -f;
}
@ -415,7 +415,7 @@ void neg_f() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @usa, align 2
// CHECK-NEXT: ret void
//
void neg_usa() {
void neg_usa(void) {
usa = -usa;
}
@ -426,7 +426,7 @@ void neg_usa() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void neg_uf() {
void neg_uf(void) {
uf = -uf;
}
@ -437,7 +437,7 @@ void neg_uf() {
// CHECK-NEXT: store i32 [[TMP1]], i32* @sa, align 4
// CHECK-NEXT: ret void
//
void neg_sa() {
void neg_sa(void) {
sa = -sa;
}
@ -448,7 +448,7 @@ void neg_sa() {
// CHECK-NEXT: store i16 [[TMP1]], i16* @sf, align 2
// CHECK-NEXT: ret void
//
void neg_sf() {
void neg_sf(void) {
sf = -sf;
}
@ -470,7 +470,7 @@ void neg_sf() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @susa, align 2
// UNSIGNED-NEXT: ret void
//
void neg_susa() {
void neg_susa(void) {
susa = -susa;
}
@ -492,7 +492,7 @@ void neg_susa() {
// UNSIGNED-NEXT: store i16 [[RESIZE1]], i16* @suf, align 2
// UNSIGNED-NEXT: ret void
//
void neg_suf() {
void neg_suf(void) {
suf = -suf;
}
@ -503,7 +503,7 @@ void neg_suf() {
// CHECK-NEXT: store i32 [[TMP0]], i32* @a, align 4
// CHECK-NEXT: ret void
//
void plus_a() {
void plus_a(void) {
a = +a;
}
@ -513,7 +513,7 @@ void plus_a() {
// CHECK-NEXT: store i16 [[TMP0]], i16* @uf, align 2
// CHECK-NEXT: ret void
//
void plus_uf() {
void plus_uf(void) {
uf = +uf;
}
@ -523,7 +523,7 @@ void plus_uf() {
// CHECK-NEXT: store i32 [[TMP0]], i32* @sa, align 4
// CHECK-NEXT: ret void
//
void plus_sa() {
void plus_sa(void) {
sa = +sa;
}
@ -537,7 +537,7 @@ void plus_sa() {
// CHECK-NEXT: store i32 [[LNOT_EXT]], i32* @i, align 4
// CHECK-NEXT: ret void
//
void not_a() {
void not_a(void) {
i = !a;
}
@ -550,7 +550,7 @@ void not_a() {
// CHECK-NEXT: store i32 [[LNOT_EXT]], i32* @i, align 4
// CHECK-NEXT: ret void
//
void not_uf() {
void not_uf(void) {
i = !uf;
}
@ -563,6 +563,6 @@ void not_uf() {
// CHECK-NEXT: store i32 [[LNOT_EXT]], i32* @i, align 4
// CHECK-NEXT: ret void
//
void not_susa() {
void not_susa(void) {
i = !susa;
}

View File

@ -1,6 +1,6 @@
// RUN: %clang_cc1 -verify -ffixed-point %s
void func() {
void func(void) {
_Bool b;
char c;
int i;

View File

@ -16,4 +16,4 @@
// RUN: %clang_cc1 -S -o - %t.ll | grep -v '\.file' > %t.ll.s
// RUN: diff %t.s %t.ll.s
int f() { return 0; }
int f(void) { return 0; }

View File

@ -23,7 +23,7 @@ int NODEREF *func(int NODEREF *arg) { // expected-note{{arg declared here}}
void func2(int x) {}
int test() {
int test(void) {
int NODEREF *p; // expected-note 34 {{p declared here}}
int *p2;

View File

@ -6,6 +6,6 @@
+ (id)new;
@end
void func() {
void func(void) {
id NODEREF obj = [NSObject new]; // expected-warning{{'noderef' can only be used on an array or pointer type}}
}

View File

@ -4,4 +4,4 @@
// CHECK: source_filename = "test/foo.c"
// CHECK: !DIFile(filename: "test/foo.c"
int main() {}
int main(void) {}

View File

@ -9,12 +9,12 @@
// CHECK: # 1 "{{.*}}system-header-line-directive-ms-lineendings.c" 2
// CHECK: # 1 "{{.*}}noline.h" 1 3
// CHECK: foo();
// CHECK: foo(void);
// CHECK: # 3 "{{.*}}system-header-line-directive-ms-lineendings.c" 2
// CHECK: # 1 "{{.*}}line-directive-in-system.h" 1 3
// The "3" below indicates that "foo.h" is considered a system header.
// CHECK: # 1 "foo.h" 3
// CHECK: foo();
// CHECK: foo(void);
// CHECK: # 4 "{{.*}}system-header-line-directive-ms-lineendings.c" 2
// CHECK: # 1 "{{.*}}line-directive.h" 1
// CHECK: # 10 "foo.h"{{$}}

View File

@ -12,12 +12,12 @@
// CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
// CHECK: # 1 "{{.*}}noline.h" 1 3
// CHECK: foo();
// CHECK: foo(void);
// CHECK: # 4 "{{.*}}system-header-line-directive.c" 2
// CHECK: # 1 "{{.*}}line-directive-in-system.h" 1 3
// The "3" below indicates that "foo.h" is considered a system header.
// CHECK: # 1 "foo.h" 3
// CHECK: foo();
// CHECK: foo(void);
// CHECK: # {{[0-9]+}} "{{.*}}system-header-line-directive.c" 2
// CHECK: # 1 "{{.*}}line-directive.h" 1
// CHECK: # 10 "foo.h"{{$}}

View File

@ -100,7 +100,7 @@ GCONST int glb = 5;
# define SCONST
#endif
void foo() {
void foo(void) {
LCONST int loc = 5;
SCONST static int sta = 5;
// We don't actually expect 1-2 occurrences of this error. We're just

View File

@ -4,4 +4,4 @@
// Expect *not* to see a diagnostic for "implicit declaration of function"
// expected-no-diagnostics
void f0() { f1(); }
void f0(void) { f1(); }

View File

@ -7,7 +7,7 @@
__attribute__((__aligned__(16))) float x[20];
int main()
int main(void)
{
vector unsigned char l = vec_lvsl (0, &x[1]); // expected-warning {{is deprecated: use assignment for unaligned little endian loads/stores}}
vector unsigned char r = vec_lvsr (0, &x[1]); // expected-warning {{is deprecated: use assignment for unaligned little endian loads/stores}}

View File

@ -13,4 +13,4 @@
#ifdef _MSC_VER
#include <intrin.h>
#endif
void f() { __nop(); __dmb(0); __wfi(); }
void f(void) { __nop(); __dmb(0); __wfi(); }

View File

@ -4,16 +4,16 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -triple i686-pc-win32 -fms-compatibility-version=17.00 %s
noreturn int f(); // expected-error 1+{{}}
noreturn int f(void); // expected-error 1+{{}}
#include <stdnoreturn.h>
#include <stdnoreturn.h>
#include <stdnoreturn.h>
int g();
noreturn int g();
int noreturn g();
int g();
int g(void);
noreturn int g(void);
int noreturn g(void);
int g(void);
#include <stdalign.h>
_Static_assert(__alignas_is_defined, "");

View File

@ -22,8 +22,8 @@ typedef __typeof__(*L"") wchar_t;
extern void foo(wchar_t x);
extern void bar(size_t x);
void *baz() { return NULL; }
void quz() {
void *baz(void) { return NULL; }
void quz(void) {
va_list y;
}

View File

@ -7,7 +7,7 @@
#include <x86intrin.h>
void test0() {
void test0(void) {
// expected-no-diagnostics
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_OFF);

View File

@ -3,10 +3,10 @@
// RUN: c-index-test core -print-source-symbols -module-file %t.pch | FileCheck %s
// CHECK: [[@LINE+1]]:6 | function/C | test1 | [[TEST1_USR:.*]] | [[TEST1_CG:.*]] | Decl | rel: 0
void test1();
void test1(void);
// CHECK: [[@LINE+1]]:20 | function/C | test2 | [[TEST2_USR:.*]] | {{.*}} | Def | rel: 0
static inline void test2() {
static inline void test2(void) {
// CHECK: [[@LINE+2]]:3 | function/C | test1 | [[TEST1_USR]] | [[TEST1_CG]] | Ref,Call,RelCall,RelCont | rel: 1
// CHECK-NEXT: RelCall,RelCont | test2 | [[TEST2_USR]]
test1();

View File

@ -1,2 +1,2 @@
int *getA();
int *getA(void);

View File

@ -1 +1 @@
int *getAExtensions();
int *getAExtensions(void);

View File

@ -3,4 +3,4 @@
# pragma clang __debug crash
#endif
const char *getCrashString();
const char *getCrashString(void);

View File

@ -49,7 +49,7 @@ typedef NS_ENUM(int, An_NS_ENUM_isdoxy1) { Red, Green, Blue };
// embedded in declarators.
#define DECLARE_FUNCTION() \
void functionFromMacro() { \
void functionFromMacro(void) { \
typedef struct Struct_notdoxy Struct_notdoxy; \
}

View File

@ -19,7 +19,7 @@
#pragma clang __debug crash
#endif
void test() {
void test(void) {
const char* error = getCrashString();
}

View File

@ -12,7 +12,7 @@ int main (int argc, const char * argv[])
}
#pragma clang diagnostic ignored "-Wmisleading-indentation"
void foo() { int b=0; while (b==b); }
void foo(void) { int b=0; while (b==b); }
// RUN: env CINDEXTEST_EDITING=1 CINDEXTEST_FAILONERROR=1 c-index-test -test-load-source-reparse 5 local \
// RUN: -I%S/Inputs \

View File

@ -4,6 +4,6 @@
// CHECK-NOT: error:
int foo() {
int foo(void) {
return x;
}

View File

@ -3,6 +3,6 @@
#error CMD_MACRO undefined
#endif
int foo() {
int foo(void) {
return x;
}

View File

@ -7,6 +7,6 @@
#import "preamble-reparse-import.m-1.h"
void foo();
void foo(void);
#import "preamble-reparse-import.m-2.h"
#import "preamble-reparse-import.m-1.h"

View File

@ -8,5 +8,5 @@
#define MAC 1
#include "header.h"
void test();
void test(void);
#define MAC 2

View File

@ -1,4 +1,4 @@
int foo() { }
int foo(void) { }
int *bar(float *f) { return f; }
// RUN: c-index-test -test-load-source all %s 2>&1|FileCheck -check-prefix=CHECK-BOTH-WARNINGS %s

View File

@ -7,5 +7,5 @@
// CHECK: define{{.*}} void @foo()
// CHECK: attributes{{.*}} "profile-sample-accurate"
void foo() {
void foo(void) {
}

View File

@ -24,4 +24,4 @@
// We want to emit extern function symbols.
// CHECK-EXTERN2: bar
STORAGE int foo;
STORAGE int bar() { return 42; }
STORAGE int bar(void) { return 42; }

View File

@ -39,7 +39,7 @@
// CHECK-STATIC-NOT: foo.var
// CHECK-STD-NOT: foo
#pragma clang diagnostic ignored "-Wstatic-local-in-inline"
INLINE int foo() {
INLINE int foo(void) {
static int var = 42;
return var;
}

View File

@ -1,5 +1,5 @@
// REQUIRES: x86-registered-target
INLINE int bar() {
INLINE int bar(void) {
static int var = 42;
return var;
}

View File

@ -11,7 +11,7 @@ b;}
// comment accepted as extension /* expected-error {{// comments are not allowed in this language}}
void test2() {
void test2(void) {
const char * str =
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds" // expected-error{{string literal of length 845 exceeds maximum length 509 that C90 compilers are required to support}}
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
@ -28,13 +28,13 @@ void test2() {
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds";
}
void test3() {
void test3(void) {
(void)L"\u1234"; // expected-error {{universal character names are only valid in C99 or C++}}
(void)L'\u1234'; // expected-error {{universal character names are only valid in C99 or C++}}
}
#define PREFIX(x) foo ## x
int test4() {
int test4(void) {
int PREFIX(0p) = 0;
int *p = &PREFIX(0p+1);
return p[-1];

View File

@ -15,7 +15,7 @@ const char *errors =
"\o{8}" //expected-error {{invalid digit '8' in escape sequence}}
;
void ucn() {
void ucn(void) {
char a = '\u{1234}'; // expected-error {{character too large for enclosing character literal type}}
// expected-warning@-1 {{delimited escape sequences are a Clang extension}}
@ -31,7 +31,7 @@ void ucn() {
unsigned d = U'\u{111111111}'; //expected-error {{hex escape sequence out of range}}
}
void hex() {
void hex(void) {
char a = '\x{1}'; // expected-warning {{extension}}
char b = '\x{abcdegggggabc}'; // expected-error 5{{invalid digit 'g' in escape sequence}}
char c = '\x{ff1}'; // expected-error {{hex escape sequence out of range}}
@ -47,7 +47,7 @@ void hex() {
unsigned i = U'\x{100000000}'; // expected-error {{hex escape sequence out of range}}
}
void octal() {
void octal(void) {
char a = '\o{1}'; // expected-warning {{extension}}
char b = '\o{12345678881238}'; // expected-error 4{{invalid digit '8' in escape sequence}}
char c = '\o{777}'; // //expected-error {{octal escape sequence out of range}}
@ -60,7 +60,7 @@ void octal() {
#endif
}
void concat() {
void concat(void) {
(void)"\x{" "12}"; // expected-error {{expected '}'}}
(void)"\u{" "12}"; // expected-error {{expected '}'}}
(void)"\o{" "12}"; // expected-error {{expected '}'}}
@ -70,7 +70,7 @@ void concat() {
(void)"\o{12" "}"; // expected-error {{expected '}'}}
}
void separators() {
void separators(void) {
(void)"\x{12'3}"; // expected-error {{invalid digit ''' in escape sequence}}
(void)"\u{12'3}"; // expected-error {{invalid digit ''' in escape sequence}}
(void)"\o{12'3}"; // expected-error {{invalid digit ''' in escape sequence}}

View File

@ -32,7 +32,7 @@ int z = 2;
y b;
int foo() {
int foo(void) {
y a = x;
return x + a - z;
}

View File

@ -23,14 +23,14 @@ __complex float c3 = 1.0if;
#define USHORT 0xffffui16
#define UCHAR 0xffui8
void a() {
void a(void) {
unsigned long long m = ULLONG_MAX;
unsigned int n = UINT;
unsigned short s = USHORT;
unsigned char c = UCHAR;
}
void pr_7968()
void pr_7968(void)
{
int var1 = 0x1111111e+1;
int var2 = 0X1111111e+1;

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