llvm-project
45 строк · 1.1 Кб
1; REQUIRES: x86
2; RUN: rm -rf %t; split-file %s %t
3
4; Test ThinLTO with time trace
5; RUN: opt -module-summary %t/f.s -o %t/f.o
6; RUN: opt -module-summary %t/g.s -o %t/g.o
7; RUN: %lld --time-trace --time-trace-granularity=0 -dylib %t/f.o %t/g.o -o %t/libTest.dylib
8; RUN: cat %t/libTest.dylib.time-trace \
9; RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
10; RUN: | FileCheck %s
11
12; CHECK: "traceEvents": [
13; Check fields for an event are present
14; CHECK: "args":
15; CHECK-NEXT: "detail":
16; CHECK: "dur":
17; CHECK-NEXT: "name":
18; CHECK-NEXT: "ph":
19; CHECK-NEXT: "pid":
20; CHECK-NEXT: "tid":
21; CHECK-NEXT: "ts":
22
23; Check that an optimization event is present
24; CHECK: "name": "OptModule"
25
26;--- f.s
27target triple = "x86_64-apple-darwin"
28target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
29
30declare void @g(...)
31
32define void @f() {
33entry:
34call void (...) @g()
35ret void
36}
37
38;--- g.s
39target triple = "x86_64-apple-darwin"
40target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
41
42define void @g() {
43entry:
44ret void
45}
46