aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Basic/SourceManager.cpp2
-rw-r--r--test/Index/c-index-getCursor-test.m6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 4c24d030b8..6def967c4c 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -411,7 +411,7 @@ FileID SourceManager::createFileID(const ContentCache *File,
= SLocEntry::get(Offset, FileInfo::get(IncludePos, File, FileCharacter));
SLocEntryLoaded[PreallocatedID] = true;
FileID FID = FileID::get(PreallocatedID);
- return LastFileIDLookup = FID;
+ return FID;
}
SLocEntryTable.push_back(SLocEntry::get(NextOffset,
diff --git a/test/Index/c-index-getCursor-test.m b/test/Index/c-index-getCursor-test.m
index 8341b80a67..62701dbc0c 100644
--- a/test/Index/c-index-getCursor-test.m
+++ b/test/Index/c-index-getCursor-test.m
@@ -52,6 +52,12 @@ int main (int argc, const char * argv[]) {
main(someEnum, (const char **)bee);
}
+#define CONCAT(X, Y) X##Y
+
+void f() {
+ int CONCAT(my,_var);
+}
+
// CHECK: [1:1 - 3:1] Invalid Cursor => NoDeclFound
// CHECK: [3:1 - 7:1] ObjCInterfaceDecl=Foo:3:12
// CHECK: [7:1 - 7:7] ObjCInstanceMethodDecl=foo:7:1