Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 1 | # 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 cctest.gyp. |
| 6 | |
| 7 | import("../../gni/v8.gni") |
| 8 | |
| 9 | v8_executable("cctest") { |
| 10 | testonly = true |
| 11 | |
| 12 | sources = [ |
| 13 | "$target_gen_dir/resources.cc", |
| 14 | "cctest.cc", |
| 15 | "compiler/c-signature.h", |
| 16 | "compiler/code-assembler-tester.h", |
| 17 | "compiler/codegen-tester.cc", |
| 18 | "compiler/codegen-tester.h", |
| 19 | "compiler/function-tester.h", |
| 20 | "compiler/graph-builder-tester.h", |
| 21 | "compiler/test-basic-block-profiler.cc", |
| 22 | "compiler/test-branch-combine.cc", |
| 23 | "compiler/test-code-assembler.cc", |
| 24 | "compiler/test-gap-resolver.cc", |
| 25 | "compiler/test-graph-visualizer.cc", |
| 26 | "compiler/test-instruction.cc", |
| 27 | "compiler/test-js-constant-cache.cc", |
| 28 | "compiler/test-js-context-specialization.cc", |
| 29 | "compiler/test-js-typed-lowering.cc", |
| 30 | "compiler/test-jump-threading.cc", |
| 31 | "compiler/test-linkage.cc", |
| 32 | "compiler/test-loop-analysis.cc", |
| 33 | "compiler/test-loop-assignment-analysis.cc", |
| 34 | "compiler/test-machine-operator-reducer.cc", |
| 35 | "compiler/test-multiple-return.cc", |
| 36 | "compiler/test-node.cc", |
| 37 | "compiler/test-operator.cc", |
| 38 | "compiler/test-osr.cc", |
| 39 | "compiler/test-representation-change.cc", |
| 40 | "compiler/test-run-bytecode-graph-builder.cc", |
| 41 | "compiler/test-run-calls-to-external-references.cc", |
| 42 | "compiler/test-run-deopt.cc", |
| 43 | "compiler/test-run-inlining.cc", |
| 44 | "compiler/test-run-intrinsics.cc", |
| 45 | "compiler/test-run-jsbranches.cc", |
| 46 | "compiler/test-run-jscalls.cc", |
| 47 | "compiler/test-run-jsexceptions.cc", |
| 48 | "compiler/test-run-jsobjects.cc", |
| 49 | "compiler/test-run-jsops.cc", |
| 50 | "compiler/test-run-load-store.cc", |
| 51 | "compiler/test-run-machops.cc", |
| 52 | "compiler/test-run-native-calls.cc", |
| 53 | "compiler/test-run-stackcheck.cc", |
| 54 | "compiler/test-run-stubs.cc", |
| 55 | "compiler/test-run-variables.cc", |
| 56 | "compiler/test-run-wasm-machops.cc", |
| 57 | "compiler/test-simplified-lowering.cc", |
| 58 | "expression-type-collector.cc", |
| 59 | "expression-type-collector.h", |
| 60 | "gay-fixed.cc", |
| 61 | "gay-precision.cc", |
| 62 | "gay-shortest.cc", |
| 63 | "heap/heap-tester.h", |
| 64 | "heap/heap-utils.cc", |
| 65 | "heap/heap-utils.h", |
| 66 | "heap/test-alloc.cc", |
| 67 | "heap/test-array-buffer-tracker.cc", |
| 68 | "heap/test-compaction.cc", |
| 69 | "heap/test-heap.cc", |
| 70 | "heap/test-incremental-marking.cc", |
| 71 | "heap/test-lab.cc", |
| 72 | "heap/test-mark-compact.cc", |
| 73 | "heap/test-page-promotion.cc", |
| 74 | "heap/test-spaces.cc", |
| 75 | "interpreter/bytecode-expectations-printer.cc", |
| 76 | "interpreter/bytecode-expectations-printer.h", |
| 77 | "interpreter/interpreter-tester.cc", |
| 78 | "interpreter/source-position-matcher.cc", |
| 79 | "interpreter/source-position-matcher.h", |
| 80 | "interpreter/test-bytecode-generator.cc", |
| 81 | "interpreter/test-interpreter-intrinsics.cc", |
| 82 | "interpreter/test-interpreter.cc", |
| 83 | "interpreter/test-source-positions.cc", |
| 84 | "libsampler/test-sampler.cc", |
| 85 | "print-extension.cc", |
| 86 | "profiler-extension.cc", |
| 87 | "test-access-checks.cc", |
| 88 | "test-accessors.cc", |
| 89 | "test-api-accessors.cc", |
| 90 | "test-api-fast-accessor-builder.cc", |
| 91 | "test-api-interceptors.cc", |
| 92 | "test-api.cc", |
| 93 | "test-api.h", |
| 94 | "test-array-list.cc", |
| 95 | "test-asm-validator.cc", |
| 96 | "test-ast-expression-visitor.cc", |
| 97 | "test-ast.cc", |
| 98 | "test-atomicops.cc", |
| 99 | "test-bignum-dtoa.cc", |
| 100 | "test-bignum.cc", |
| 101 | "test-bit-vector.cc", |
| 102 | "test-circular-queue.cc", |
| 103 | "test-code-cache.cc", |
| 104 | "test-code-layout.cc", |
| 105 | "test-code-stub-assembler.cc", |
| 106 | "test-compiler.cc", |
| 107 | "test-constantpool.cc", |
| 108 | "test-conversions.cc", |
| 109 | "test-cpu-profiler.cc", |
| 110 | "test-date.cc", |
| 111 | "test-debug.cc", |
| 112 | "test-decls.cc", |
| 113 | "test-deoptimization.cc", |
| 114 | "test-dictionary.cc", |
| 115 | "test-diy-fp.cc", |
| 116 | "test-double.cc", |
| 117 | "test-dtoa.cc", |
| 118 | "test-eh-frame-hdr.cc", |
| 119 | "test-elements-kind.cc", |
| 120 | "test-fast-dtoa.cc", |
| 121 | "test-feedback-vector.cc", |
| 122 | "test-field-type-tracking.cc", |
| 123 | "test-fixed-dtoa.cc", |
| 124 | "test-flags.cc", |
| 125 | "test-func-name-inference.cc", |
| 126 | "test-global-handles.cc", |
| 127 | "test-global-object.cc", |
| 128 | "test-hashing.cc", |
| 129 | "test-hashmap.cc", |
| 130 | "test-heap-profiler.cc", |
| 131 | "test-hydrogen-types.cc", |
| 132 | "test-identity-map.cc", |
| 133 | "test-inobject-slack-tracking.cc", |
| 134 | "test-list.cc", |
| 135 | "test-liveedit.cc", |
| 136 | "test-lockers.cc", |
| 137 | "test-log.cc", |
| 138 | "test-mementos.cc", |
| 139 | "test-parsing.cc", |
| 140 | "test-platform.cc", |
| 141 | "test-profile-generator.cc", |
| 142 | "test-random-number-generator.cc", |
| 143 | "test-receiver-check-hidden-prototype.cc", |
| 144 | "test-regexp.cc", |
| 145 | "test-reloc-info.cc", |
| 146 | "test-representation.cc", |
| 147 | "test-sampler-api.cc", |
| 148 | "test-serialize.cc", |
| 149 | "test-simd.cc", |
| 150 | "test-strings.cc", |
| 151 | "test-strtod.cc", |
| 152 | "test-symbols.cc", |
| 153 | "test-thread-termination.cc", |
| 154 | "test-threads.cc", |
| 155 | "test-trace-event.cc", |
| 156 | "test-transitions.cc", |
| 157 | "test-typedarrays.cc", |
| 158 | "test-types.cc", |
| 159 | "test-unbound-queue.cc", |
| 160 | "test-unboxed-doubles.cc", |
| 161 | "test-unique.cc", |
| 162 | "test-unscopables-hidden-prototype.cc", |
| 163 | "test-usecounters.cc", |
| 164 | "test-utils.cc", |
| 165 | "test-version.cc", |
| 166 | "test-weakmaps.cc", |
| 167 | "test-weaksets.cc", |
| 168 | "trace-extension.cc", |
| 169 | "wasm/test-run-wasm-64.cc", |
| 170 | "wasm/test-run-wasm-asmjs.cc", |
| 171 | "wasm/test-run-wasm-interpreter.cc", |
| 172 | "wasm/test-run-wasm-js.cc", |
| 173 | "wasm/test-run-wasm-module.cc", |
| 174 | "wasm/test-run-wasm-relocation.cc", |
| 175 | "wasm/test-run-wasm.cc", |
| 176 | "wasm/test-signatures.h", |
| 177 | "wasm/test-wasm-function-name-table.cc", |
| 178 | "wasm/test-wasm-stack.cc", |
| 179 | "wasm/test-wasm-trap-position.cc", |
| 180 | "wasm/wasm-run-utils.h", |
| 181 | ] |
| 182 | |
| 183 | if (v8_target_cpu == "arm") { |
| 184 | sources += [ |
| 185 | "test-assembler-arm.cc", |
| 186 | "test-code-stubs-arm.cc", |
| 187 | "test-code-stubs.cc", |
| 188 | "test-disasm-arm.cc", |
| 189 | "test-macro-assembler-arm.cc", |
| 190 | "test-run-wasm-relocation-arm.cc", |
| 191 | ] |
| 192 | } else if (v8_target_cpu == "arm64") { |
| 193 | sources += [ |
| 194 | "test-assembler-arm64.cc", |
| 195 | "test-code-stubs-arm64.cc", |
| 196 | "test-code-stubs.cc", |
| 197 | "test-disasm-arm64.cc", |
| 198 | "test-fuzz-arm64.cc", |
| 199 | "test-javascript-arm64.cc", |
| 200 | "test-js-arm64-variables.cc", |
| 201 | "test-run-wasm-relocation-arm64.cc", |
| 202 | "test-utils-arm64.cc", |
| 203 | ] |
| 204 | } else if (v8_target_cpu == "x86") { |
| 205 | sources += [ |
| 206 | "test-assembler-ia32.cc", |
| 207 | "test-code-stubs-ia32.cc", |
| 208 | "test-code-stubs.cc", |
| 209 | "test-disasm-ia32.cc", |
| 210 | "test-log-stack-tracer.cc", |
| 211 | "test-macro-assembler-ia32.cc", |
| 212 | "test-run-wasm-relocation-ia32.cc", |
| 213 | ] |
| 214 | } else if (v8_target_cpu == "mips") { |
| 215 | sources += [ |
| 216 | "test-assembler-mips.cc", |
| 217 | "test-code-stubs-mips.cc", |
| 218 | "test-code-stubs.cc", |
| 219 | "test-disasm-mips.cc", |
| 220 | "test-macro-assembler-mips.cc", |
| 221 | ] |
| 222 | } else if (v8_target_cpu == "mipsel") { |
| 223 | sources += [ |
| 224 | "test-assembler-mips.cc", |
| 225 | "test-code-stubs-mips.cc", |
| 226 | "test-code-stubs.cc", |
| 227 | "test-disasm-mips.cc", |
| 228 | "test-macro-assembler-mips.cc", |
| 229 | ] |
| 230 | } else if (v8_target_cpu == "mips64") { |
| 231 | sources += [ |
| 232 | "test-assembler-mips64.cc", |
| 233 | "test-code-stubs-mips64.cc", |
| 234 | "test-code-stubs.cc", |
| 235 | "test-disasm-mips64.cc", |
| 236 | "test-macro-assembler-mips64.cc", |
| 237 | ] |
| 238 | } else if (v8_target_cpu == "mips64el") { |
| 239 | sources += [ |
| 240 | "test-assembler-mips64.cc", |
| 241 | "test-code-stubs-mips64.cc", |
| 242 | "test-code-stubs.cc", |
| 243 | "test-disasm-mips64.cc", |
| 244 | "test-macro-assembler-mips64.cc", |
| 245 | ] |
| 246 | } else if (v8_target_cpu == "x64") { |
| 247 | sources += [ |
| 248 | "test-assembler-x64.cc", |
| 249 | "test-code-stubs-x64.cc", |
| 250 | "test-code-stubs.cc", |
| 251 | "test-disasm-x64.cc", |
| 252 | "test-log-stack-tracer.cc", |
| 253 | "test-macro-assembler-x64.cc", |
| 254 | "test-run-wasm-relocation-x64.cc", |
| 255 | ] |
| 256 | } else if (v8_target_cpu == "x87") { |
| 257 | sources += [ |
| 258 | "test-assembler-x87.cc", |
| 259 | "test-code-stubs-x87.cc", |
| 260 | "test-code-stubs.cc", |
| 261 | "test-disasm-x87.cc", |
| 262 | "test-log-stack-tracer.cc", |
| 263 | "test-macro-assembler-x87.cc", |
| 264 | "test-run-wasm-relocation-x87.cc", |
| 265 | ] |
| 266 | } else if (v8_target_cpu == "ppc" || v8_target_cpu == "ppc64") { |
| 267 | sources += [ |
| 268 | "test-assembler-ppc.cc", |
| 269 | "test-code-stubs.cc", |
| 270 | "test-disasm-ppc.cc", |
| 271 | ] |
| 272 | } else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") { |
| 273 | sources += [ |
| 274 | "test-assembler-s390.cc", |
| 275 | "test-code-stubs.cc", |
| 276 | "test-disasm-s390.cc", |
| 277 | ] |
| 278 | } |
| 279 | |
| 280 | if (is_linux) { |
| 281 | # TODO(machenbach): Translate 'or OS=="qnx"' from gyp. |
| 282 | sources += [ "test-platform-linux.cc" ] |
| 283 | } else if (is_win) { |
| 284 | sources += [ "test-platform-win32.cc" ] |
| 285 | # TODO(machenbach): Translate from gyp. |
| 286 | # "msvs_settings": { |
| 287 | # "VCCLCompilerTool": { |
| 288 | # # MSVS wants this for gay-{precision,shortest}.cc. |
| 289 | # "AdditionalOptions": ["/bigobj"], |
| 290 | # }, |
| 291 | # }, |
| 292 | } |
| 293 | |
| 294 | configs = [ |
| 295 | "../..:external_config", |
| 296 | "../..:internal_config_base", |
| 297 | ] |
| 298 | |
| 299 | # TODO(machenbach): Translate from gyp. |
| 300 | #['v8_target_cpu=="ppc" or v8_target_cpu=="ppc64" \ |
| 301 | # or v8_target_cpu=="arm" or v8_target_cpu=="arm64" \ |
| 302 | # or v8_target_cpu=="s390" or v8_target_cpu=="s390x"', { |
| 303 | # # disable fmadd/fmsub so that expected results match generated code in |
| 304 | # # RunFloat64MulAndFloat64Add1 and friends. |
| 305 | # 'cflags': ['-ffp-contract=off'], |
| 306 | #}], |
| 307 | |
| 308 | # TODO(machenbach): Translate from gyp. |
| 309 | #["OS=="aix"", { |
| 310 | # "ldflags": [ "-Wl,-bbigtoc" ], |
| 311 | #}], |
| 312 | |
| 313 | deps = [ |
| 314 | ":resources", |
| 315 | "../..:v8_libplatform", |
| 316 | "//build/config/sanitizers:deps", |
| 317 | "//build/win:default_exe_manifest", |
| 318 | ] |
| 319 | |
| 320 | if (is_component_build) { |
| 321 | # cctest can't be built against a shared library, so we |
| 322 | # need to depend on the underlying static target in that case. |
| 323 | deps += [ "../..:v8_maybe_snapshot" ] |
| 324 | } else { |
| 325 | deps += [ "../..:v8" ] |
| 326 | } |
| 327 | |
| 328 | if (is_win) { |
| 329 | # This warning is benignly triggered by the U16 and U32 macros in |
| 330 | # bytecode-utils.h. |
| 331 | # C4309: 'static_cast': truncation of constant value |
| 332 | cflags = [ "/wd4309" ] |
| 333 | |
| 334 | # Suppress warnings about importing locally defined symbols. |
| 335 | if (is_component_build) { |
| 336 | ldflags = [ |
| 337 | "/ignore:4049", |
| 338 | "/ignore:4217", |
| 339 | ] |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | action("resources") { |
| 345 | visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 346 | |
| 347 | script = "../../tools/js2c.py" |
| 348 | |
| 349 | # The script depends on this other script, this rule causes a rebuild if it |
| 350 | # changes. |
| 351 | inputs = [ |
| 352 | "../../tools/jsmin.py", |
| 353 | ] |
| 354 | |
| 355 | # NOSORT |
| 356 | sources = [ |
| 357 | "../../tools/splaytree.js", |
| 358 | "../../tools/codemap.js", |
| 359 | "../../tools/csvparser.js", |
| 360 | "../../tools/consarray.js", |
| 361 | "../../tools/profile.js", |
| 362 | "../../tools/profile_view.js", |
| 363 | "../../tools/logreader.js", |
| 364 | "log-eq-of-logging-and-traversal.js", |
| 365 | ] |
| 366 | |
| 367 | outputs = [ |
| 368 | "$target_gen_dir/resources.cc", |
| 369 | ] |
| 370 | |
| 371 | args = [ |
| 372 | rebase_path("$target_gen_dir/resources.cc", root_build_dir), |
| 373 | "TEST", |
| 374 | ] |
| 375 | args += rebase_path(sources, root_build_dir) |
| 376 | } |
| 377 | |
| 378 | v8_executable("generate-bytecode-expectations") { |
| 379 | sources = [ |
| 380 | "interpreter/bytecode-expectations-printer.cc", |
| 381 | "interpreter/bytecode-expectations-printer.h", |
| 382 | "interpreter/generate-bytecode-expectations.cc", |
| 383 | ] |
| 384 | |
| 385 | configs = [ |
| 386 | "../..:external_config", |
| 387 | "../..:internal_config_base", |
| 388 | ] |
| 389 | |
| 390 | deps = [ |
| 391 | "../..:v8_libplatform", |
| 392 | "//build/config/sanitizers:deps", |
| 393 | "//build/win:default_exe_manifest", |
| 394 | ] |
| 395 | |
| 396 | if (is_component_build) { |
| 397 | # Same as cctest, we need to depend on the underlying static target. |
| 398 | deps += [ "../..:v8_maybe_snapshot" ] |
| 399 | } else { |
| 400 | deps += [ "../..:v8" ] |
| 401 | } |
| 402 | } |