2016-06-01 14:14:28 +00:00
|
|
|
# Copyright 2016 The V8 project authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2016-06-28 13:22:46 +00:00
|
|
|
# The sources are kept automatically in sync with cctest.gyp.
|
2016-06-01 14:14:28 +00:00
|
|
|
|
|
|
|
import("../../gni/v8.gni")
|
|
|
|
|
2016-06-28 13:22:46 +00:00
|
|
|
gypi_values = exec_script("//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("cctest.gyp") ],
|
|
|
|
"scope",
|
|
|
|
[ "cctest.gyp" ])
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
v8_executable("cctest") {
|
2016-06-01 14:14:28 +00:00
|
|
|
testonly = true
|
|
|
|
|
2016-07-25 09:31:44 +00:00
|
|
|
sources = [ "$target_gen_dir/resources.cc" ] + gypi_values.cctest_sources
|
2016-06-01 14:14:28 +00:00
|
|
|
|
2016-07-15 22:32:55 +00:00
|
|
|
if (v8_current_cpu == "arm") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_arm
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "arm64") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_arm64
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "x86") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_ia32
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "mips") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_mips
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "mipsel") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_mipsel
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "mips64") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_mips64
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "mips64el") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_mips64el
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "x64") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_x64
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "x87") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_x87
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_ppc
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.cctest_sources_s390
|
2016-06-01 14:14:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (is_linux) {
|
|
|
|
# TODO(machenbach): Translate 'or OS=="qnx"' from gyp.
|
|
|
|
sources += [ "test-platform-linux.cc" ]
|
|
|
|
} else if (is_win) {
|
|
|
|
sources += [ "test-platform-win32.cc" ]
|
|
|
|
}
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
configs = [
|
2016-06-01 14:14:28 +00:00
|
|
|
"../..:external_config",
|
|
|
|
"../..:internal_config_base",
|
|
|
|
]
|
|
|
|
|
|
|
|
# TODO(machenbach): Translate from gyp.
|
|
|
|
#["OS=="aix"", {
|
|
|
|
# "ldflags": [ "-Wl,-bbigtoc" ],
|
|
|
|
#}],
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":resources",
|
|
|
|
"../..:v8_libplatform",
|
|
|
|
"//build/config/sanitizers:deps",
|
|
|
|
"//build/win:default_exe_manifest",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (is_component_build) {
|
|
|
|
# cctest can't be built against a shared library, so we
|
|
|
|
# need to depend on the underlying static target in that case.
|
|
|
|
deps += [ "../..:v8_maybe_snapshot" ]
|
|
|
|
} else {
|
|
|
|
deps += [ "../..:v8" ]
|
|
|
|
}
|
2016-06-03 08:21:11 +00:00
|
|
|
|
2016-07-25 09:31:44 +00:00
|
|
|
cflags = []
|
|
|
|
ldflags = []
|
|
|
|
|
|
|
|
if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" ||
|
|
|
|
v8_current_cpu == "arm" || v8_current_cpu == "arm64" ||
|
|
|
|
v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
|
|
|
|
# Disable fmadd/fmsub so that expected results match generated code in
|
|
|
|
# RunFloat64MulAndFloat64Add1 and friends.
|
|
|
|
cflags += [ "-ffp-contract=off" ]
|
|
|
|
}
|
|
|
|
|
2016-06-03 08:21:11 +00:00
|
|
|
if (is_win) {
|
|
|
|
# This warning is benignly triggered by the U16 and U32 macros in
|
|
|
|
# bytecode-utils.h.
|
|
|
|
# C4309: 'static_cast': truncation of constant value
|
2016-07-25 09:31:44 +00:00
|
|
|
cflags += [ "/wd4309" ]
|
|
|
|
|
|
|
|
# MSVS wants this for gay-{precision,shortest}.cc.
|
|
|
|
cflags += [ "/bigobj" ]
|
2016-06-03 08:21:11 +00:00
|
|
|
|
|
|
|
# Suppress warnings about importing locally defined symbols.
|
|
|
|
if (is_component_build) {
|
2016-07-25 09:31:44 +00:00
|
|
|
ldflags += [
|
2016-06-14 21:38:21 +00:00
|
|
|
"/ignore:4049",
|
|
|
|
"/ignore:4217",
|
|
|
|
]
|
2016-06-03 08:21:11 +00:00
|
|
|
}
|
|
|
|
}
|
2016-06-01 14:14:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
action("resources") {
|
|
|
|
visibility = [ ":*" ] # Only targets in this file can depend on this.
|
|
|
|
|
|
|
|
script = "../../tools/js2c.py"
|
|
|
|
|
|
|
|
# The script depends on this other script, this rule causes a rebuild if it
|
|
|
|
# changes.
|
|
|
|
inputs = [
|
|
|
|
"../../tools/jsmin.py",
|
|
|
|
]
|
|
|
|
|
|
|
|
# NOSORT
|
|
|
|
sources = [
|
|
|
|
"../../tools/splaytree.js",
|
|
|
|
"../../tools/codemap.js",
|
|
|
|
"../../tools/csvparser.js",
|
|
|
|
"../../tools/consarray.js",
|
|
|
|
"../../tools/profile.js",
|
|
|
|
"../../tools/profile_view.js",
|
|
|
|
"../../tools/logreader.js",
|
|
|
|
"log-eq-of-logging-and-traversal.js",
|
|
|
|
]
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"$target_gen_dir/resources.cc",
|
|
|
|
]
|
|
|
|
|
|
|
|
args = [
|
|
|
|
rebase_path("$target_gen_dir/resources.cc", root_build_dir),
|
|
|
|
"TEST",
|
|
|
|
]
|
|
|
|
args += rebase_path(sources, root_build_dir)
|
|
|
|
}
|
2016-06-27 11:55:33 +00:00
|
|
|
|
|
|
|
v8_executable("generate-bytecode-expectations") {
|
|
|
|
sources = [
|
|
|
|
"interpreter/bytecode-expectations-printer.cc",
|
|
|
|
"interpreter/bytecode-expectations-printer.h",
|
|
|
|
"interpreter/generate-bytecode-expectations.cc",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs = [
|
|
|
|
"../..:external_config",
|
|
|
|
"../..:internal_config_base",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
"../..:v8_libplatform",
|
|
|
|
"//build/config/sanitizers:deps",
|
|
|
|
"//build/win:default_exe_manifest",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (is_component_build) {
|
|
|
|
# Same as cctest, we need to depend on the underlying static target.
|
|
|
|
deps += [ "../..:v8_maybe_snapshot" ]
|
|
|
|
} else {
|
|
|
|
deps += [ "../..:v8" ]
|
|
|
|
}
|
2016-08-22 16:50:16 +00:00
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
# Suppress warnings about importing locally defined symbols.
|
|
|
|
if (is_component_build) {
|
|
|
|
ldflags = [
|
|
|
|
"/ignore:4049",
|
|
|
|
"/ignore:4217",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2016-06-27 11:55:33 +00:00
|
|
|
}
|