blob: b962673fb2bb76be24a156964a2c58f7159bc73e [file] [log] [blame]
Ben Murdoch61f157c2016-09-16 13:49:30 +01001# Copyright 2016 The V8 project authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# Please keep this file in sync with unittests.gyp.
6
7import("../../gni/v8.gni")
8
9v8_executable("unittests") {
10 testonly = true
11
12 sources = [
13 "base/atomic-utils-unittest.cc",
14 "base/bits-unittest.cc",
15 "base/cpu-unittest.cc",
16 "base/division-by-constant-unittest.cc",
17 "base/flags-unittest.cc",
18 "base/functional-unittest.cc",
19 "base/ieee754-unittest.cc",
20 "base/iterator-unittest.cc",
21 "base/logging-unittest.cc",
22 "base/platform/condition-variable-unittest.cc",
23 "base/platform/mutex-unittest.cc",
24 "base/platform/platform-unittest.cc",
25 "base/platform/semaphore-unittest.cc",
26 "base/platform/time-unittest.cc",
27 "base/sys-info-unittest.cc",
28 "base/utils/random-number-generator-unittest.cc",
29 "cancelable-tasks-unittest.cc",
30 "char-predicates-unittest.cc",
31 "compiler/branch-elimination-unittest.cc",
32 "compiler/checkpoint-elimination-unittest.cc",
33 "compiler/common-operator-reducer-unittest.cc",
34 "compiler/common-operator-unittest.cc",
35 "compiler/compiler-test-utils.h",
36 "compiler/control-equivalence-unittest.cc",
37 "compiler/control-flow-optimizer-unittest.cc",
38 "compiler/dead-code-elimination-unittest.cc",
39 "compiler/diamond-unittest.cc",
40 "compiler/effect-control-linearizer-unittest.cc",
41 "compiler/escape-analysis-unittest.cc",
42 "compiler/graph-reducer-unittest.cc",
43 "compiler/graph-reducer-unittest.h",
44 "compiler/graph-trimmer-unittest.cc",
45 "compiler/graph-unittest.cc",
46 "compiler/graph-unittest.h",
47 "compiler/instruction-selector-unittest.cc",
48 "compiler/instruction-selector-unittest.h",
49 "compiler/instruction-sequence-unittest.cc",
50 "compiler/instruction-sequence-unittest.h",
51 "compiler/int64-lowering-unittest.cc",
52 "compiler/js-builtin-reducer-unittest.cc",
53 "compiler/js-create-lowering-unittest.cc",
54 "compiler/js-intrinsic-lowering-unittest.cc",
55 "compiler/js-operator-unittest.cc",
56 "compiler/js-typed-lowering-unittest.cc",
57 "compiler/linkage-tail-call-unittest.cc",
58 "compiler/live-range-unittest.cc",
59 "compiler/liveness-analyzer-unittest.cc",
60 "compiler/load-elimination-unittest.cc",
61 "compiler/loop-peeling-unittest.cc",
62 "compiler/machine-operator-reducer-unittest.cc",
63 "compiler/machine-operator-unittest.cc",
64 "compiler/move-optimizer-unittest.cc",
65 "compiler/node-cache-unittest.cc",
66 "compiler/node-matchers-unittest.cc",
67 "compiler/node-properties-unittest.cc",
68 "compiler/node-test-utils.cc",
69 "compiler/node-test-utils.h",
70 "compiler/node-unittest.cc",
71 "compiler/opcodes-unittest.cc",
72 "compiler/register-allocator-unittest.cc",
73 "compiler/schedule-unittest.cc",
74 "compiler/scheduler-rpo-unittest.cc",
75 "compiler/scheduler-unittest.cc",
76 "compiler/simplified-operator-reducer-unittest.cc",
77 "compiler/simplified-operator-unittest.cc",
78 "compiler/state-values-utils-unittest.cc",
79 "compiler/tail-call-optimization-unittest.cc",
80 "compiler/typer-unittest.cc",
81 "compiler/value-numbering-reducer-unittest.cc",
82 "compiler/zone-pool-unittest.cc",
83 "counters-unittest.cc",
84 "heap/bitmap-unittest.cc",
85 "heap/gc-idle-time-handler-unittest.cc",
86 "heap/gc-tracer-unittest.cc",
87 "heap/heap-unittest.cc",
88 "heap/memory-reducer-unittest.cc",
89 "heap/scavenge-job-unittest.cc",
90 "heap/slot-set-unittest.cc",
91 "interpreter/bytecode-array-builder-unittest.cc",
92 "interpreter/bytecode-array-iterator-unittest.cc",
93 "interpreter/bytecode-array-writer-unittest.cc",
94 "interpreter/bytecode-dead-code-optimizer-unittest.cc",
95 "interpreter/bytecode-peephole-optimizer-unittest.cc",
96 "interpreter/bytecode-pipeline-unittest.cc",
97 "interpreter/bytecode-register-allocator-unittest.cc",
98 "interpreter/bytecode-register-optimizer-unittest.cc",
99 "interpreter/bytecodes-unittest.cc",
100 "interpreter/constant-array-builder-unittest.cc",
101 "interpreter/interpreter-assembler-unittest.cc",
102 "interpreter/interpreter-assembler-unittest.h",
103 "interpreter/source-position-table-unittest.cc",
104 "libplatform/default-platform-unittest.cc",
105 "libplatform/task-queue-unittest.cc",
106 "libplatform/worker-thread-unittest.cc",
107 "locked-queue-unittest.cc",
108 "register-configuration-unittest.cc",
109 "run-all-unittests.cc",
110 "test-utils.cc",
111 "test-utils.h",
112 "wasm/asm-types-unittest.cc",
113 "wasm/ast-decoder-unittest.cc",
114 "wasm/control-transfer-unittest.cc",
115 "wasm/decoder-unittest.cc",
116 "wasm/encoder-unittest.cc",
117 "wasm/leb-helper-unittest.cc",
118 "wasm/loop-assignment-analysis-unittest.cc",
119 "wasm/module-decoder-unittest.cc",
120 "wasm/switch-logic-unittest.cc",
121 "wasm/wasm-macro-gen-unittest.cc",
122 ]
123
124 if (v8_target_cpu == "arm") {
125 sources += [ "compiler/arm/instruction-selector-arm-unittest.cc" ]
126 } else if (v8_target_cpu == "arm64") {
127 sources += [ "compiler/arm64/instruction-selector-arm64-unittest.cc" ]
128 } else if (v8_target_cpu == "x86") {
129 sources += [ "compiler/ia32/instruction-selector-ia32-unittest.cc" ]
130 } else if (v8_target_cpu == "mips" || v8_target_cpu == "mipsel") {
131 sources += [ "compiler/mips/instruction-selector-mips-unittest.cc" ]
132 } else if (v8_target_cpu == "mips64" || v8_target_cpu == "mips64el") {
133 sources += [ "compiler/mips64/instruction-selector-mips64-unittest.cc" ]
134 } else if (v8_target_cpu == "x64") {
135 sources += [ "compiler/x64/instruction-selector-x64-unittest.cc" ]
136 } else if (v8_target_cpu == "ppc" || v8_target_cpu == "ppc64") {
137 sources += [ "compiler/ppc/instruction-selector-ppc-unittest.cc" ]
138 } else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") {
139 sources += [ "compiler/s390/instruction-selector-s390-unittest.cc" ]
140 }
141
142 configs = [
143 "../..:external_config",
144 "../..:internal_config_base",
145 ]
146
147 # TODO(machenbach): Translate from gyp.
148 #['OS=="aix"', {
149 # 'ldflags': [ '-Wl,-bbigtoc' ],
150 #}],
151
152 deps = [
153 "../..:v8_libplatform",
154 "//build/config/sanitizers:deps",
155 "//build/win:default_exe_manifest",
156 "//testing/gmock",
157 "//testing/gtest",
158 ]
159
160 if (is_component_build) {
161 # compiler-unittests can't be built against a shared library, so we
162 # need to depend on the underlying static target in that case.
163 deps += [ "../..:v8_maybe_snapshot" ]
164 } else {
165 deps += [ "../..:v8" ]
166 }
167
168 if (is_win) {
169 # This warning is benignly triggered by the U16 and U32 macros in
170 # bytecode-utils.h.
171 # C4309: 'static_cast': truncation of constant value
172 cflags = [ "/wd4309" ]
173
174 # Suppress warnings about importing locally defined symbols.
175 if (is_component_build) {
176 ldflags = [
177 "/ignore:4049",
178 "/ignore:4217",
179 ]
180 }
181 }
182}