@@ -46,8 +46,8 @@ func foo() {}
4646// SEMA_3: 1 {{.*}} source.statistic.num-ast-builds
4747// SEMA_3: 1 {{.*}} source.statistic.num-asts-in-memory
4848// SEMA_3: 1 {{.*}} source.statistic.max-asts-in-memory
49- // SEMA_3: 0 {{.*}} source.statistic.num-ast-cache-hits
50- // SEMA_3: 1 {{.*}} source.statistic.num-ast-snaphost-uses
49+ // SEMA_3: 1 {{.*}} source.statistic.num-ast-cache-hits
50+ // SEMA_3: 0 {{.*}} source.statistic.num-ast-snaphost-uses
5151
5252// RUN: %sourcekitd-test -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=related-idents -pos=1:6 %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == -req=stats | %FileCheck %s -check-prefix=SEMA_4
5353
@@ -58,3 +58,14 @@ func foo() {}
5858// SEMA_4: 1 {{.*}} source.statistic.max-asts-in-memory
5959// SEMA_4: 1 {{.*}} source.statistic.num-ast-cache-hits
6060// SEMA_4: 0 {{.*}} source.statistic.num-ast-snaphost-uses
61+
62+ // Test that we can have two files open and don't need to rebuild an AST when doing the cursor info request on '%s' after opening '10bytes.swift'
63+ // RUN: %sourcekitd-test \
64+ // RUN: -req=sema %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == \
65+ // RUN: -req=sema %S/Inputs/10bytes.swift -- -Xfrontend -disable-implicit-concurrency-module-import %S/Inputs/10bytes.swift == \
66+ // RUN: -req=cursor -pos=1:6 %s -- -Xfrontend -disable-implicit-concurrency-module-import %s == \
67+ // RUN: -req=stats | %FileCheck %s -check-prefix=OPEN_TWO_FILES
68+
69+ // OPEN_TWO_FILES: 2 {{.*}} source.statistic.num-ast-builds
70+ // OPEN_TWO_FILES: 2 {{.*}} source.statistic.num-asts-in-memory
71+ // OPEN_TWO_FILES: 2 {{.*}} source.statistic.max-asts-in-memory
0 commit comments