[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Driver / check-time-trace.cpp
blob52b3e71394fba5f0d7daed0d0aaa001e7543051c
1 // RUN: %clangxx -S -ftime-trace -ftime-trace-granularity=0 -o %T/check-time-trace %s
2 // RUN: cat %T/check-time-trace.json \
3 // RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
4 // RUN: | FileCheck %s
5 // RUN: %clangxx -S -ftime-trace=%T/new-name.json -ftime-trace-granularity=0 -o %T/check-time-trace %s
6 // RUN: cat %T/new-name.json \
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
9 // RUN: rm -rf %T/output1 && mkdir %T/output1
10 // RUN: %clangxx -S -ftime-trace=%T/output1 -ftime-trace-granularity=0 -o %T/check-time-trace %s
11 // RUN: cat %T/output1/check-time-trace.json \
12 // RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
13 // RUN: | FileCheck %s
14 // RUN: rm -rf %T/output2 && mkdir %T/output2
15 // RUN: %clangxx -S -ftime-trace=%T/output2/ -ftime-trace-granularity=0 -o %T/check-time-trace %s
16 // RUN: cat %T/output2/check-time-trace.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 // CHECK: "beginningOfTime": {{[0-9]{16},}}
21 // CHECK-NEXT: "traceEvents": [
22 // CHECK: "args":
23 // CHECK: "detail":
24 // CHECK: "dur":
25 // CHECK: "name":
26 // CHECK-NEXT: "ph":
27 // CHECK-NEXT: "pid":
28 // CHECK-NEXT: "tid":
29 // CHECK-NEXT: "ts":
30 // CHECK: "name": "clang{{.*}}"
31 // CHECK: "name": "process_name"
32 // CHECK: "name": "thread_name"
34 template <typename T>
35 struct Struct {
36 T Num;
39 int main() {
40 Struct<int> S;
42 return 0;