diff options
author | dim <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
commit | 36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch) | |
tree | 0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Index/preamble.c | |
parent | fc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff) | |
download | FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz |
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020
Approved by: rpaulo (mentor)
Diffstat (limited to 'test/Index/preamble.c')
-rw-r--r-- | test/Index/preamble.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Index/preamble.c b/test/Index/preamble.c new file mode 100644 index 0000000..54abf99 --- /dev/null +++ b/test/Index/preamble.c @@ -0,0 +1,28 @@ +#include "prefix.h" +#include "preamble.h" +int wibble(int); + +void f(int x) { + +} +// RUN: c-index-test -write-pch %t.pch -x c-header %S/Inputs/prefix.h +// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source-reparse 5 local -I %S/Inputs -include %t %s 2> %t.stderr.txt | FileCheck %s +// RUN: FileCheck -check-prefix CHECK-DIAG %s < %t.stderr.txt +// CHECK: preamble.h:1:12: FunctionDecl=bar:1:12 (Definition) Extent=[1:12 - 6:2] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[1:23 - 6:2] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[2:3 - 2:16] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[3:3 - 3:15] +// CHECK: preamble.h:4:3: UnexposedExpr= Extent=[4:3 - 4:13] +// CHECK: preamble.h:4:3: DeclRefExpr=ptr:2:8 Extent=[4:3 - 4:6] +// CHECK: preamble.h:4:9: UnexposedExpr=ptr1:3:10 Extent=[4:9 - 4:13] +// CHECK: preamble.h:4:9: DeclRefExpr=ptr1:3:10 Extent=[4:9 - 4:13] +// CHECK: <invalid loc>:0:0: UnexposedStmt= Extent=[5:3 - 5:11] +// CHECK: preamble.h:5:10: UnexposedExpr= Extent=[5:10 - 5:11] +// CHECK: preamble.c:3:5: FunctionDecl=wibble:3:5 Extent=[3:5 - 3:16] +// CHECK: preamble.c:3:15: ParmDecl=:3:15 (Definition) Extent=[3:12 - 3:16] +// CHECK-DIAG: preamble.h:4:7:{4:9-4:13}: warning: incompatible pointer types assigning to 'int *' from 'float *' +// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:6:1 -I %S/Inputs -include %t %s 2> %t.stderr.txt | FileCheck -check-prefix CHECK-CC %s +// CHECK-CC: FunctionDecl:{ResultType int}{TypedText bar}{LeftParen (}{Placeholder int i}{RightParen )} (50) +// CHECK-CC: FunctionDecl:{ResultType void}{TypedText f}{LeftParen (}{Placeholder int x}{RightParen )} (45) +// CHECK-CC: FunctionDecl:{ResultType int}{TypedText foo}{LeftParen (}{Placeholder int}{RightParen )} (50) +// CHECK-CC: FunctionDecl:{ResultType int}{TypedText wibble}{LeftParen (}{Placeholder int}{RightParen )} (50) |