summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Index/Inputs/module-undef.h2
-rw-r--r--clang/test/Index/Inputs/module.map2
-rw-r--r--clang/test/Index/complete-module-undef.m8
3 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Index/Inputs/module-undef.h b/clang/test/Index/Inputs/module-undef.h
new file mode 100644
index 00000000000..8212d755a0f
--- /dev/null
+++ b/clang/test/Index/Inputs/module-undef.h
@@ -0,0 +1,2 @@
+#define MY_MACRO 1
+#undef MY_MACRO
diff --git a/clang/test/Index/Inputs/module.map b/clang/test/Index/Inputs/module.map
index 8f24840c81f..4bfc109a8b1 100644
--- a/clang/test/Index/Inputs/module.map
+++ b/clang/test/Index/Inputs/module.map
@@ -4,3 +4,5 @@ module ModuleNeedsVFS {
export *
}
framework module * { }
+
+module ModuleUndef { header "module-undef.h" }
diff --git a/clang/test/Index/complete-module-undef.m b/clang/test/Index/complete-module-undef.m
new file mode 100644
index 00000000000..a9dd0009641
--- /dev/null
+++ b/clang/test/Index/complete-module-undef.m
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t
+// RUN: env CINDEXTEST_COMPLETION_CACHING=1 \
+// RUN: c-index-test -test-load-source-reparse 2 local %s -fmodules -fmodules-cache-path=%t -I %S/Inputs \
+// RUN: | FileCheck %s
+
+// rdar://18416901 (used to crash)
+// CHECK: complete-module-undef.m:8:1: ModuleImport=ModuleUndef:8:1 (Definition) Extent=[8:1 - 8:20]
+@import ModuleUndef;
OpenPOWER on IntegriCloud