2010-04-24 09:30:46 +08:00
|
|
|
// RUN: cp %s %t
|
|
|
|
// RUN: %clang_cc1 -pedantic -fixit -x c %t || true
|
|
|
|
// RUN: grep -v CHECK %t > %t2
|
|
|
|
// RUN: %clang_cc1 -pedantic -Werror -x c %t
|
|
|
|
// RUN: FileCheck -input-file=%t2 %t
|
2009-04-02 06:41:11 +08:00
|
|
|
|
|
|
|
/* This is a test of the various code modification hints that are
|
2009-04-02 11:20:30 +08:00
|
|
|
provided as part of warning or extension diagnostics. All of the
|
|
|
|
warnings will be fixed by -fixit, and the resulting file should
|
|
|
|
compile cleanly with -Werror -pedantic. */
|
2009-11-18 06:25:16 +08:00
|
|
|
|
|
|
|
// FIXME: FIX-IT should add #include <string.h>?
|
|
|
|
int strcmp(const char *s1, const char *s2);
|
2009-04-02 06:41:11 +08:00
|
|
|
|
|
|
|
void f0(void) { };
|
|
|
|
|
|
|
|
struct s {
|
|
|
|
int x, y;;
|
|
|
|
};
|
|
|
|
|
2009-11-15 03:25:21 +08:00
|
|
|
// CHECK: _Complex double cd;
|
2009-04-02 06:41:11 +08:00
|
|
|
_Complex cd;
|
|
|
|
|
2009-11-15 03:25:21 +08:00
|
|
|
// CHECK: struct s s0 = { .y = 5 };
|
2009-04-02 06:41:11 +08:00
|
|
|
struct s s0 = { y: 5 };
|
2009-11-15 03:25:21 +08:00
|
|
|
|
|
|
|
// CHECK: int array0[5] = { [3] = 3 };
|
2009-04-02 06:41:11 +08:00
|
|
|
int array0[5] = { [3] 3 };
|
2009-04-02 07:51:29 +08:00
|
|
|
|
2010-04-24 09:30:46 +08:00
|
|
|
void f1(x, y)
|
2009-04-02 07:51:29 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int i0 = { 17 };
|
|
|
|
|
2010-04-21 05:33:39 +08:00
|
|
|
int test_cond(int y, int fooBar) {
|
|
|
|
// CHECK: int x = y ? 1 : 4+fooBar;
|
|
|
|
int x = y ? 1 4+foobar;
|
2010-04-13 06:10:35 +08:00
|
|
|
return x;
|
|
|
|
}
|
2010-08-23 22:34:43 +08:00
|
|
|
|
|
|
|
// CHECK: typedef int int_t;
|
|
|
|
typedef typedef int int_t;
|
2010-09-07 22:51:08 +08:00
|
|
|
|
|
|
|
// <rdar://problem/7159693>
|
|
|
|
enum Color {
|
|
|
|
Red // expected-error{{missing ',' between enumerators}}
|
|
|
|
Green = 17 // expected-error{{missing ',' between enumerators}}
|
|
|
|
Blue,
|
|
|
|
};
|