1; REQUIRES: x86 2 3; Test ThinLTO with time trace 4; RUN: opt -module-summary %s -o %t1.o 5; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o 6 7; Test single-threaded 8; RUN: ld.lld --thinlto-jobs=1 --time-trace --time-trace-granularity=0 -shared %t1.o %t2.o -o %t3.so 9; RUN: cat %t3.so.time-trace \ 10; RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \ 11; RUN: | FileCheck %s 12 13; Test multi-threaded 14; RUN: ld.lld --time-trace --time-trace-granularity=0 -shared %t1.o %t2.o -o %t4.so 15; RUN: cat %t4.so.time-trace \ 16; RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \ 17; RUN: | FileCheck %s 18 19; CHECK: "traceEvents": [ 20; Check fields for an event are present 21; CHECK: "args": 22; CHECK-NEXT: "detail": 23; CHECK: "dur": 24; CHECK-NEXT: "name": 25; CHECK-NEXT: "ph": 26; CHECK-NEXT: "pid": 27; CHECK-NEXT: "tid": 28; CHECK-NEXT: "ts": 29 30; Check that an optimisation event is present 31; CHECK: "name": "OptModule" 32 33target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 34target triple = "x86_64-unknown-linux-gnu" 35 36declare void @g(...) 37 38define void @f() { 39entry: 40 call void (...) @g() 41 ret void 42} 43 44