Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / time-trace.s
blobaa21bf8a1a4289184d4e0e39c0e2f33d99dfa604
1 ## When running main twice, we'll also output the time trace JSON twice, which
2 ## breaks JSON parsing.
3 # XFAIL: main-run-twice
5 # REQUIRES: x86
6 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
8 ## Test implicit trace file name
9 # RUN: %lld --time-trace --time-trace-granularity=0 -o %t1.macho %t.o
10 # 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 %s
14 ## Test specified trace file name.
15 # RUN: %lld --time-trace=%t2.json --time-trace-granularity=0 -o %t2.macho %t.o
16 # 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 %s
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 %s
25 # CHECK: "beginningOfTime": {{[0-9]{16},}}
26 # CHECK-NEXT: "traceEvents": [
28 ## Check one event has correct fields
29 # CHECK: "dur":
30 # CHECK-NEXT: "name":
31 # CHECK-NEXT: "ph":
32 # CHECK-NEXT: "pid":
33 # CHECK-NEXT: "tid":
34 # CHECK-NEXT: "ts":
36 ## Check there is an ExecuteLinker event
37 # CHECK: "name": "ExecuteLinker"
39 ## Check process_name entry field
40 # CHECK: "name": "ld64.lld{{(.exe)?}}"
41 # CHECK: "name": "process_name"
42 # CHECK: "name": "thread_name"
44 .globl _main
45 _main:
46 ret