Commit 6d4f5647 by Jim Stichnoth

Subzero: The cross tests should use the actual Subzero runtime.

BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/560493002
parent 742d72d8
......@@ -224,23 +224,3 @@ int main(int argc, char **argv) {
<< " Failures=" << Failures << "\n";
return Failures;
}
////////////////////////////////////////////////////////////////
// The following are helper definitions that should be part of the
// Subzero runtime.
extern "C" {
uint32_t cvtdtoui32(double a) { return (uint32_t)a; }
uint32_t cvtftoui32(float a) { return (uint32_t)a; }
int64_t cvtdtosi64(double a) { return (int64_t)a; }
int64_t cvtftosi64(float a) { return (int64_t)a; }
uint64_t cvtdtoui64(double a) { return (uint64_t)a; }
uint64_t cvtftoui64(float a) { return (uint64_t)a; }
float cvtui64tof(uint64_t a) { return (float)a; }
double cvtui64tod(uint64_t a) { return (double)a; }
float cvtsi64tof(int64_t a) { return (float)a; }
float cvtui32tof(uint32_t a) { return (float)a; }
double cvtui32tod(uint32_t a) { return (double)a; }
double cvtsi64tod(int64_t a) { return (double)a; }
}
......@@ -162,11 +162,3 @@ int main(int argc, char *argv[]) {
return Failures;
}
extern "C" {
void ice_unreachable(void) {
std::cerr << "\"unreachable\" instruction encountered\n";
abort();
}
}
......@@ -122,6 +122,7 @@ if __name__ == '__main__':
# failures. This behavior can be inspected by switching
# use_llc between True and False.
use_llc = False
pure_c = os.path.splitext(args.driver)[1] == '.c'
if not args.crosstest_bitcode:
objs.append(arg)
elif use_llc:
......@@ -133,7 +134,11 @@ if __name__ == '__main__':
else:
objs.append(bitcode)
linker = 'clang' if os.path.splitext(args.driver)[1] == '.c' else 'clang++'
# Use 'clang szrt.c' -or- 'clang++ szrt.cpp'
objs.append((
'{root}/toolchain_build/src/subzero/runtime/szrt.{ext}'
).format(root=nacl_root, ext='c' if pure_c else 'cpp'))
linker = 'clang' if pure_c else 'clang++'
shellcmd([linker, '-g', '-m32', args.driver] +
objs +
['-lm', '-lpthread', '-o', os.path.join(args.dir, args.output)])
//===- subzero/runtime/szrt.cpp - Subzero runtime source ------------------===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is a C++ wrapper to szrt.c since clang++ complains about
// .c files.
//
//===----------------------------------------------------------------------===//
extern "C" {
#include "szrt.c"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment