blob: 1e710c28afccae77aafdea44fb4efa45469041c9 [file] [log] [blame]
Douglas Gregor4814fb52011-02-03 23:41:12 +00001// RUN: c-index-test -test-load-source all -fspell-checking %s 2> %t
2// RUN: FileCheck %s < %t
3struct X {
4 int wibble;
5};
6
7#define MACRO(X) X
8
9void f(struct X *x) {
10 // CHECK: error: no member named 'wobble' in 'struct X'; did you mean 'wibble'?
Argyrios Kyrtzidiseba8cd52012-04-11 18:15:01 +000011 // CHECK: FIX-IT: Replace [13:12 - 13:18] with "wibble"
Douglas Gregor4814fb52011-02-03 23:41:12 +000012 // CHECK: note: 'wibble' declared here
13 MACRO(x->wobble = 17);
14 // CHECK: error: no member named 'wabble' in 'struct X'; did you mean 'wibble'?
15 // CHECK: FIX-IT: Replace [17:6 - 17:12] with "wibble"
16 // CHECK: note: 'wibble' declared here
17 x->wabble = 17;
18}
Argyrios Kyrtzidiseba8cd52012-04-11 18:15:01 +000019
20int printf(const char *restrict, ...);
21
22void f2() {
23 unsigned long index;
24 // CHECK: warning: format specifies type 'int' but the argument has type 'unsigned long'
Jordan Rosecdbe1e02013-01-17 22:34:10 +000025 // CHECK: FIX-IT: Replace [26:17 - 26:19] with "%lu"
Argyrios Kyrtzidiseba8cd52012-04-11 18:15:01 +000026 MACRO(printf("%d", index));
27}