aboutsummaryrefslogtreecommitdiff
path: root/test/Index/complete-driver-errors.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-12 00:50:20 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-12 00:50:20 +0000
commit4cd912aa94656697a44c3ebb159f05060300524e (patch)
treeeaec37a41189e2a7322c2b634ab41b3bf2f78f0f /test/Index/complete-driver-errors.c
parent9c4bb2c08989265411925a04252fd4f93c26e3b1 (diff)
When we load an ASTUnit from command-line arguments, hold on to the
diagnostics produced by the driver itself. Previously, we were allowing these to either be dropped or to slip through to stderr. Fixes <rdar://problem/7595339>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116285 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/complete-driver-errors.c')
-rw-r--r--test/Index/complete-driver-errors.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Index/complete-driver-errors.c b/test/Index/complete-driver-errors.c
new file mode 100644
index 0000000000..0d2ceb94d4
--- /dev/null
+++ b/test/Index/complete-driver-errors.c
@@ -0,0 +1,23 @@
+int *blah = 1;
+
+int
+
+// Test driver errors with code completion
+// RUN: c-index-test -code-completion-at=%s:4:1 -std= %s 2> %t | FileCheck -check-prefix=CHECK-RESULTS %s
+// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t
+// CHECK-RESULTS: NotImplemented:{TypedText const} (30)
+// CHECK-RESULTS: NotImplemented:{TypedText restrict} (30)
+// CHECK-RESULTS: NotImplemented:{TypedText volatile} (30)
+
+// Test driver errors with parsing
+// RUN: c-index-test -test-load-source all -std= %s 2> %t | FileCheck -check-prefix=CHECK-LOAD %s
+// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t
+// CHECK-LOAD: complete-driver-errors.c:1:6: VarDecl=blah:1:6
+
+// CHECK-DIAGS: error: invalid value '' in '-std='
+// CHECK-DIAGS: complete-driver-errors.c:1:6:{1:13-1:14}: warning: incompatible integer to pointer conversion initializing 'int *' with an expression of type 'int'
+// Test driver errors with code completion and precompiled preamble
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -code-completion-at=%s:4:1 -std= %s 2> %t | FileCheck -check-prefix=CHECK-RESULTS %s
+// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source all -std= %s 2> %t | FileCheck -check-prefix=CHECK-LOAD %s
+// RUN: FileCheck -check-prefix=CHECK-DIAGS %s < %t