[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / time-trace.s
blobf7c18dff92fd6aaf5c1b637bbf2d7428ffeced85
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 # Test implicit trace file name
5 # RUN: ld.lld --time-trace --time-trace-granularity=0 -o %t1.elf %t.o
6 # RUN: cat %t1.elf.time-trace \
7 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
8 # RUN: | FileCheck %s
10 # Test specified trace file name
11 # RUN: ld.lld --time-trace --time-trace-file=%t2.json --time-trace-granularity=0 -o %t2.elf %t.o
12 # RUN: cat %t2.json \
13 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
14 # RUN: | FileCheck %s
16 # Test trace requested to stdout
17 # RUN: ld.lld --time-trace --time-trace-file=- --time-trace-granularity=0 -o %t3.elf %t.o \
18 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
19 # RUN: | FileCheck %s
21 # CHECK: "beginningOfTime": {{[0-9]{16},}}
22 # CHECK-NEXT: "traceEvents": [
24 # Check one event has correct fields
25 # CHECK: "dur":
26 # CHECK-NEXT: "name":
27 # CHECK-NEXT: "ph":
28 # CHECK-NEXT: "pid":
29 # CHECK-NEXT: "tid":
30 # CHECK-NEXT: "ts":
32 # Check there is an ExecuteLinker event
33 # CHECK: "name": "ExecuteLinker"
35 # Check process_name entry field
36 # CHECK: "name": "ld.lld{{(.exe)?}}"
37 # CHECK: "name": "process_name"
38 # CHECK: "name": "thread_name"
40 .globl _start
41 _start:
42 ret