Skip to content

Commit 9d34041

Browse files
committed
[Stats] Add a test for -profile-stats-{events,entities}
1 parent 628c446 commit 9d34041

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/Misc/stats_dir_profiler.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %empty-directory(%t/stats-events)
3+
// RUN: %empty-directory(%t/stats-entities)
4+
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t/stats-events %s -profile-stats-events
5+
// RUN: %target-swiftc_driver -o %t/main -module-name main -stats-output-dir %t/stats-entities %s -profile-stats-entities
6+
// RUN: %FileCheck -check-prefix=EVENTS -input-file %t/stats-events/*.dir/Time.User.events %s
7+
// RUN: %FileCheck -check-prefix=ENTITIES -input-file %t/stats-entities/*.dir/Time.User.entities %s
8+
9+
// EVENTS: {{perform-sema;.*;typecheck-decl [0-9]+}}
10+
// ENTITIES: {{perform-sema;.*;typecheck-fn bar\(\);typecheck-decl <pattern binding> [0-9]+}}
11+
12+
public func foo() {
13+
print("hello")
14+
}
15+
16+
protocol Proto {
17+
func bar() -> Int;
18+
}
19+
20+
class Bar {
21+
typealias T = Int
22+
}
23+
24+
extension Bar : Proto {
25+
func bar() -> T {
26+
let x = 1
27+
let y = Int(1.0)
28+
return x + y
29+
}
30+
}

0 commit comments

Comments
 (0)