summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r--clang-tools-extra/test/include-fixer/Inputs/fake_yaml_db.yaml8
-rw-r--r--clang-tools-extra/test/include-fixer/prefix_variable.cpp11
2 files changed, 19 insertions, 0 deletions
diff --git a/clang-tools-extra/test/include-fixer/Inputs/fake_yaml_db.yaml b/clang-tools-extra/test/include-fixer/Inputs/fake_yaml_db.yaml
index 4d9c219150a..a2f991324f7 100644
--- a/clang-tools-extra/test/include-fixer/Inputs/fake_yaml_db.yaml
+++ b/clang-tools-extra/test/include-fixer/Inputs/fake_yaml_db.yaml
@@ -43,3 +43,11 @@ FilePath: ../include/zbar.h
LineNumber: 1
Type: Class
NumOccurrences: 3
+---
+Name: b
+Contexts:
+FilePath: var.h
+LineNumber: 1
+Type: Variable
+NumOccurrences: 1
+...
diff --git a/clang-tools-extra/test/include-fixer/prefix_variable.cpp b/clang-tools-extra/test/include-fixer/prefix_variable.cpp
new file mode 100644
index 00000000000..f2f565d4a81
--- /dev/null
+++ b/clang-tools-extra/test/include-fixer/prefix_variable.cpp
@@ -0,0 +1,11 @@
+// REQUIRES: shell
+// RUN: sed -e 's#//.*$##' %s > %t.cpp
+// RUN: clang-include-fixer -db=yaml -input=%p/Inputs/fake_yaml_db.yaml %t.cpp --
+// RUN: FileCheck %s -input-file=%t.cpp
+
+// CHECK-NOT: #include
+// CHECK: doesnotexist f;
+
+namespace b {
+doesnotexist f;
+}
OpenPOWER on IntegriCloud