From 3d4ebcd7eeb6e12aa86d57bbf39339c7d1375b11 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Mon, 18 Dec 2017 20:39:45 -0800 Subject: [PATCH] Update tests for llvm 4 --- src/platform_win.cc | 18 ++++- tests/macros/foo.cc | 20 +----- tests/{ => objective-c}/class.m | 120 +++++++++++--------------------- tests/outline/outline2.cc | 2 +- 4 files changed, 63 insertions(+), 97 deletions(-) rename tests/{ => objective-c}/class.m (52%) diff --git a/src/platform_win.cc b/src/platform_win.cc index a78bb823..497518bf 100644 --- a/src/platform_win.cc +++ b/src/platform_win.cc @@ -227,7 +227,23 @@ bool IsSymLink(const std::string& path) { } std::vector GetPlatformClangArguments() { - return {"-fms-compatibility", "-fdelayed-template-parsing"}; + // + // Found by executing + // + // $ clang++ -E -x c++ - -v + // + + return { + "-isystem","C:/Program Files/Microsoft Visual Studio 10.0/VC/include", + "-isystem","C:/Program Files/Microsoft Visual Studio 9.0/VC/include", + "-isystem","C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include", + "-isystem","C:/Program Files/Microsoft Visual Studio 8/VC/include", + "-isystem","C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include", + "-isystem","C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.10.25017/include", + "-isystem","C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/ucrt", + "-isystem","C:/Program Files/LLVM/lib/clang/4.0.0/include", + "-fms-extensions", "-fms-compatibility", "-fms-compatibility-version=18", "-fdelayed-template-parsing" + }; } void FreeUnusedMemory() {} diff --git a/tests/macros/foo.cc b/tests/macros/foo.cc index 8be3582c..4437e954 100644 --- a/tests/macros/foo.cc +++ b/tests/macros/foo.cc @@ -22,26 +22,12 @@ OUTPUT: "parents": [], "derived": [], "types": [], - "funcs": [0], + "funcs": [], "vars": [], "instances": [], - "uses": ["4:8-4:11", "5:12-5:15"] - }], - "funcs": [{ - "id": 0, - "is_operator": false, - "usr": "c:@S@Foo@F@Foo#&&$@S@Foo#", - "short_name": "Foo", - "detailed_name": "void Foo::Foo(Foo &&)", - "declarations": [], - "definition_spelling": "5:12-5:15", - "definition_extent": "5:12-5:16", - "declaring_type": 0, - "derived": [], - "locals": [], - "callers": [], - "callees": [] + "uses": ["4:8-4:11"] }], + "funcs": [], "vars": [{ "id": 0, "usr": "c:@x", diff --git a/tests/class.m b/tests/objective-c/class.m similarity index 52% rename from tests/class.m rename to tests/objective-c/class.m index 42503cee..1ca93f1f 100644 --- a/tests/class.m +++ b/tests/objective-c/class.m @@ -1,15 +1,11 @@ -#import - -@interface AClass: NSObject +@interface AClass + + (void)test; - (void)anInstanceMethod; @property (nonatomic) int aProp; - @property (readonly) int readOnlyProp; @end @implementation AClass -- (void)anInstanceMethod { - NSLog(@"instance method"); -} +- (void)anInstanceMethod {} @end int main(void) @@ -22,53 +18,66 @@ int main(void) /* OUTPUT: { - "includes": [{ - "line": 1, - "resolved_path": "&Foundation.h" - }], + "includes": [], "skipped_by_preprocessor": [], "types": [{ "id": 0, "usr": "c:objc(cs)AClass", "short_name": "AClass", "detailed_name": "AClass", - "definition_spelling": "9:17-9:23", - "definition_extent": "9:1-13:2", + "definition_spelling": "7:17-7:23", + "definition_extent": "7:1-9:2", "parents": [], "derived": [], "types": [], "funcs": [], "vars": [], "instances": [], - "uses": ["3:12-3:18", "9:17-9:23", "17:3-17:9", "17:23-17:29"] + "uses": ["1:12-1:18", "7:17-7:23", "13:3-13:9", "13:23-13:29"] }], "funcs": [{ "id": 0, "is_operator": false, + "usr": "c:objc(cs)AClass(cm)test", + "short_name": "test", + "detailed_name": " AClass::test", + "declarations": [{ + "spelling": "2:11-2:15", + "extent": "2:3-2:16", + "content": "+ (void)test;", + "param_spellings": [] + }], + "derived": [], + "locals": [], + "callers": [], + "callees": [] + }, { + "id": 1, + "is_operator": false, "usr": "c:objc(cs)AClass(im)anInstanceMethod", "short_name": "anInstanceMethod", "detailed_name": " AClass::anInstanceMethod", "declarations": [{ - "spelling": "4:11-4:27", - "extent": "4:3-4:28", + "spelling": "3:11-3:27", + "extent": "3:3-3:28", "content": "- (void)anInstanceMethod;", "param_spellings": [] }], - "definition_spelling": "10:9-10:25", - "definition_extent": "10:1-12:2", + "definition_spelling": "8:9-8:25", + "definition_extent": "8:1-8:28", "derived": [], "locals": [], - "callers": ["4@18:13-18:29"], + "callers": ["4@14:13-14:29"], "callees": [] }, { - "id": 1, + "id": 2, "is_operator": false, "usr": "c:objc(cs)AClass(im)aProp", "short_name": "aProp", "detailed_name": " AClass::aProp", "declarations": [{ "spelling": "0:0-0:0", - "extent": "5:29-5:34", + "extent": "4:29-4:34", "content": "aProp", "param_spellings": [] }], @@ -77,37 +86,21 @@ OUTPUT: "callers": [], "callees": [] }, { - "id": 2, + "id": 3, "is_operator": false, "usr": "c:objc(cs)AClass(im)setAProp:", "short_name": "setAProp:", "detailed_name": " AClass::setAProp:", "declarations": [{ "spelling": "0:0-0:0", - "extent": "5:29-5:34", + "extent": "4:29-4:34", "content": "aProp", - "param_spellings": ["5:29-5:34"] + "param_spellings": ["4:29-4:34"] }], "derived": [], "locals": [], "callers": ["4@0:0-0:0"], "callees": [] - }, { - "id": 3, - "is_operator": false, - "usr": "c:objc(cs)AClass(im)readOnlyProp", - "short_name": "readOnlyProp", - "detailed_name": " AClass::readOnlyProp", - "declarations": [{ - "spelling": "0:0-0:0", - "extent": "6:28-6:40", - "content": "readOnlyProp", - "param_spellings": [] - }], - "derived": [], - "locals": [], - "callers": [], - "callees": [] }, { "id": 4, "is_operator": false, @@ -115,61 +108,32 @@ OUTPUT: "short_name": "main", "detailed_name": "int main()", "declarations": [], - "definition_spelling": "15:5-15:9", - "definition_extent": "15:1-20:2", + "definition_spelling": "11:5-11:9", + "definition_extent": "11:1-16:2", "derived": [], "locals": [], "callers": [], - "callees": ["0@18:13-18:29", "2@0:0-0:0"] + "callees": ["1@14:13-14:29", "3@0:0-0:0"] }], "vars": [{ "id": 0, "usr": "c:objc(cs)AClass(py)aProp", "short_name": "aProp", "detailed_name": "int AClass::aProp", - "declaration": "5:29-5:34", + "declaration": "4:29-4:34", "is_local": true, "is_macro": false, - "uses": ["5:29-5:34", "19:12-19:17"] + "uses": ["4:29-4:34", "15:12-15:17"] }, { "id": 1, - "usr": "c:objc(cs)AClass(py)readOnlyProp", - "short_name": "readOnlyProp", - "detailed_name": "int AClass::readOnlyProp", - "declaration": "6:28-6:40", - "is_local": true, - "is_macro": false, - "uses": ["6:28-6:40"] - }, { - "id": 2, - "usr": "c:objc(cs)AClass@_aProp", - "short_name": "_aProp", - "detailed_name": "int AClass::_aProp", - "definition_spelling": "5:29-5:34", - "definition_extent": "5:29-5:34", - "is_local": true, - "is_macro": false, - "uses": ["5:29-5:34"] - }, { - "id": 3, - "usr": "c:objc(cs)AClass@_readOnlyProp", - "short_name": "_readOnlyProp", - "detailed_name": "int AClass::_readOnlyProp", - "definition_spelling": "6:28-6:40", - "definition_extent": "6:28-6:40", - "is_local": true, - "is_macro": false, - "uses": ["6:28-6:40"] - }, { - "id": 4, - "usr": "c:class.m@297@F@main#@instance", + "usr": "c:class.m@191@F@main#@instance", "short_name": "instance", "detailed_name": "AClass * instance", - "definition_spelling": "17:11-17:19", - "definition_extent": "17:3-17:35", + "definition_spelling": "13:11-13:19", + "definition_extent": "13:3-13:35", "is_local": true, "is_macro": false, - "uses": ["17:11-17:19", "18:4-18:12", "19:3-19:11"] + "uses": ["13:11-13:19", "14:4-14:12", "15:3-15:11"] }] } */ diff --git a/tests/outline/outline2.cc b/tests/outline/outline2.cc index 01992a98..04d6459f 100644 --- a/tests/outline/outline2.cc +++ b/tests/outline/outline2.cc @@ -47,7 +47,7 @@ OUTPUT: "funcs": [], "vars": [], "instances": [0, 1], - "uses": ["7:8-7:14", "8:8-8:14", "9:20-9:26"] + "uses": ["7:8-7:14", "8:8-8:14", "9:20-9:26", "12:78-12:84"] }, { "id": 2, "usr": "c:@N@std@ST>2#T#T@vector",