File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
tools/lldb-moduleimport-test Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -1207,6 +1207,7 @@ CompilerInvocation::loadFromSerializedAST(StringRef data) {
1207
1207
if (info.status != serialization::Status::Valid)
1208
1208
return info.status ;
1209
1209
1210
+ LangOpts.EffectiveLanguageVersion = info.compatibilityVersion ;
1210
1211
setTargetTriple (info.targetTriple );
1211
1212
if (!extendedInfo.getSDKPath ().empty ())
1212
1213
setSDKPath (extendedInfo.getSDKPath ());
Original file line number Diff line number Diff line change 2
2
3
3
// RUN: %empty-directory(%t)
4
4
5
- // RUN: %target-swift-frontend -c -sdk /fake/sdk/path -Xcc -DA -Xcc -DB -emit-module -o %t %S/ASTSection.swift
5
+ // RUN: %target-swift-frontend -c -sdk /fake/sdk/path -Xcc -DA -Xcc -DB -emit-module -o %t %S/ASTSection.swift -swift-version 3
6
6
// RUN: %swift-ide-test -test-CompilerInvocation-from-module -source-filename=%t/ASTSection.swiftmodule
7
7
8
8
// Test the inline section mechanism.
16
16
// REQUIRES: OS=macosx
17
17
18
18
// CHECK: - Swift Version: {{.+}}.{{.+}}
19
+ // CHECK: - Compatibility Version: 3
19
20
// CHECK: - Target: {{.+}}-{{.+}}-{{.+}}
20
21
// CHECK: - SDK path: /fake/sdk/path{{$}}
21
22
// CHECK: - -Xcc options: -working-directory {{.+}} -DA -DB
Original file line number Diff line number Diff line change @@ -42,16 +42,25 @@ void anchorForGetMainExecutable() {}
42
42
43
43
using namespace llvm ::MachO;
44
44
45
- static bool validateModule (llvm::StringRef data, bool Verbose,
46
- swift::serialization::ValidationInfo &info,
47
- swift::serialization::ExtendedValidationInfo &extendedInfo) {
45
+ static bool
46
+ validateModule (llvm::StringRef data, bool Verbose,
47
+ swift::serialization::ValidationInfo &info,
48
+ swift::serialization::ExtendedValidationInfo &extendedInfo) {
48
49
info = swift::serialization::validateSerializedAST (data, &extendedInfo);
49
50
if (info.status != swift::serialization::Status::Valid)
50
51
return false ;
51
52
53
+ swift::CompilerInvocation CI;
54
+ if (CI.loadFromSerializedAST (data) != swift::serialization::Status::Valid)
55
+ return false ;
56
+
52
57
if (Verbose) {
53
58
if (!info.shortVersion .empty ())
54
59
llvm::outs () << " - Swift Version: " << info.shortVersion << " \n " ;
60
+ llvm::outs () << " - Compatibility Version: "
61
+ << CI.getLangOptions ()
62
+ .EffectiveLanguageVersion .asAPINotesVersionString ()
63
+ << " \n " ;
55
64
llvm::outs () << " - Target: " << info.targetTriple << " \n " ;
56
65
if (!extendedInfo.getSDKPath ().empty ())
57
66
llvm::outs () << " - SDK path: " << extendedInfo.getSDKPath () << " \n " ;
You can’t perform that action at this time.
0 commit comments