@@ -15,7 +15,8 @@ func test() {
1515// UNSUPPORTED: OS=windows-msvc
1616
1717// -----------------------------------------------------------------------------
18- // Test that modifications for frameworks in '-Fsystem' doesn't affect the result.
18+ // Test that modifications for frameworks in '-Fsystem' doesn't affect the result
19+ // within a session, and that they are propagated after restarting SourceKit.
1920
2021// RUN: %empty-directory(%t/ModuleCache)
2122// RUN: %empty-directory(%t/System/Frameworks)
@@ -69,7 +70,7 @@ func test() {
6970// RUN: -shell -- cp -R %S/../Inputs/build_session/Frameworks_modified/FooHelper.framework %t/System/Frameworks/ == \
7071// RUN: -shell -- echo '## TWO' == \
7172// RUN: -req=sema %s -- %s -D TWO -F %t/Frameworks -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache \
72- // RUN: | tee %t.reponse | %FileCheck %s --check-prefix=CHECK_USER
73+ // RUN: | %FileCheck %s --check-prefix=CHECK_USER
7374
7475// CHECK_USER-LABEL: ## ONE
7576// CHECK_USER-NOT: key.description
@@ -81,3 +82,35 @@ func test() {
8182// CHECK_USER: key.severity: source.diagnostic.severity.error,
8283// CHECK_USER-NEXT: key.description: "use of unresolved identifier 'fooSubFunc'",
8384// CHECK_USER-NOT: key.severity:
85+
86+ // -----------------------------------------------------------------------------
87+ // Test that modifications for frameworks in '-Fsystem' doesn't affect the result
88+ // across SourceKit sessions *if* '-disable-modules-validate-system-headers' is
89+ // passed.
90+
91+ // RUN: %empty-directory(%t/ModuleCache)
92+ // RUN: %empty-directory(%t/System/Frameworks)
93+ // RUN: cp -R %S/../Inputs/build_session/Frameworks/Foo.framework %t/System/Frameworks/
94+ // RUN: cp -R %S/../Inputs/build_session/Frameworks/FooHelper.framework %t/System/Frameworks/
95+ // RUN: %sourcekitd-test \
96+ // RUN: -shell -- echo '## ONE' == \
97+ // RUN: -req=sema %s -- %s -D ONE -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache -Xfrontend -disable-modules-validate-system-headers == \
98+ // RUN: -shell -- cp -R %S/../Inputs/build_session/Frameworks_modified/Foo.framework %t/System/Frameworks/ == \
99+ // RUN: -shell -- cp -R %S/../Inputs/build_session/Frameworks_modified/FooHelper.framework %t/System/Frameworks/ == \
100+ // RUN: -shell -- echo '## TWO' == \
101+ // RUN: -req=sema %s -- %s -D TWO -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache -Xfrontend -disable-modules-validate-system-headers \
102+ // RUN: | %FileCheck %s --check-prefix=CHECK_DISABLED
103+ // RUN: sleep 2
104+ // RUN: %sourcekitd-test \
105+ // RUN: -shell -- echo '## THREE' == \
106+ // RUN: -req=sema %s -- %s -D THREE -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache -Xfrontend -disable-modules-validate-system-headers \
107+ // RUN: | %FileCheck %s --check-prefix=CHECK_DISABLED_2
108+
109+ // CHECK_DISABLED-LABEL: ## ONE
110+ // CHECK_DISABLED-NOT: key.description
111+
112+ // CHECK_DISABLED-LABEL: ## TWO
113+ // CHECK_DISABLED-NOT: key.description
114+
115+ // CHECK_DISABLED_2-LABEL: ## THREE
116+ // CHECK_DISABLED_2-NOT: key.description
0 commit comments