summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/code-complete-errors.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-28 06:00:51 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-28 06:00:51 +0000
commitac0605e927c487a79954ce6ae716aefc8ff098f4 (patch)
tree649996d452748b06a01e7757cfb0e76993ab8ce0 /clang/test/Index/code-complete-errors.c
parentfee0e96c82b6cb8e07961b8a83514cb65c5f47d2 (diff)
downloadbcm5719-llvm-ac0605e927c487a79954ce6ae716aefc8ff098f4.tar.gz
bcm5719-llvm-ac0605e927c487a79954ce6ae716aefc8ff098f4.zip
Introduce serialization and deserialization of diagnostic information
so that CIndex can report diagnostics through the normal mechanisms even when executing Clang in a separate process. This applies both when performing code completion and when using ASTs as an intermediary for clang_createTranslationUnitFromSourceFile(). The serialized format is not perfect at the moment, because it does not encapsulate macro-instantiation information. Instead, it maps all source locations back to the instantiation location. However, it does maintain source-range and fix-it information. To get perfect fidelity from the serialized format would require serializing a large chunk of the source manager; at present, it isn't clear if this code will live long enough for that to matter. llvm-svn: 94740
Diffstat (limited to 'clang/test/Index/code-complete-errors.c')
-rw-r--r--clang/test/Index/code-complete-errors.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Index/code-complete-errors.c b/clang/test/Index/code-complete-errors.c
new file mode 100644
index 00000000000..43bc5d8a1a2
--- /dev/null
+++ b/clang/test/Index/code-complete-errors.c
@@ -0,0 +1,16 @@
+_Complex cd; // CHECK: code-complete-errors.c:1:1: warning: plain '_Complex' requires a type specifier; assuming '_Complex double'
+
+struct s {
+ int x, y;;
+};
+
+struct s s0 = { y: 5 }; // CHECK: code-complete-errors.c:7:20: warning: use of GNU old-style field designator extension
+
+int f(int *ptr1, float *ptr2) {
+ return ptr1 != ptr2; // CHECK: code-complete-errors.c:10:15: warning: comparison of distinct pointer types ('int *' and 'float *')
+}
+
+void g() { }
+
+// RUN: c-index-test -code-completion-at=%s:13:12 %s 2> %t
+// RUN: FileCheck -check-prefix=CHECK %s < %t
OpenPOWER on IntegriCloud