47 lines · plain
1## When running main twice, we'll also output the time trace JSON twice, which2## breaks JSON parsing.3# XFAIL: main-run-twice4 5# REQUIRES: x866# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o7 8## Test implicit trace file name9# RUN: %lld --time-trace --time-trace-granularity=0 -o %t1.macho %t.o10# RUN: cat %t1.macho.time-trace \11# RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \12# RUN: | FileCheck %s13 14## Test specified trace file name.15# RUN: %lld --time-trace=%t2.json --time-trace-granularity=0 -o %t2.macho %t.o16# RUN: cat %t2.json \17# RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \18# RUN: | FileCheck %s19 20## Test trace requested to stdout.21# RUN: %lld --time-trace=- --time-trace-granularity=0 -o %t3.macho %t.o \22# RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \23# RUN: | FileCheck %s24 25# CHECK: "beginningOfTime": {{[0-9]{16},}}26# CHECK-NEXT: "traceEvents": [27 28## Check one event has correct fields29# CHECK: "dur":30# CHECK-NEXT: "name":31# CHECK-NEXT: "ph":32# CHECK-NEXT: "pid":33# CHECK-NEXT: "tid":34# CHECK-NEXT: "ts":35 36## Check there is an ExecuteLinker event37# CHECK: "name": "ExecuteLinker"38 39## Check process_name entry field40# CHECK: "name": "ld64.lld{{(.exe)?}}"41# CHECK: "name": "process_name"42# CHECK: "name": "thread_name"43 44.globl _main45_main:46 ret47