Commit 7da431b5 by Jim Stichnoth

Subzero: Fix and clean up some cross tests.

1. It turns out that the crosstest scripts mix different versions of clang - build_pnacl_ir.py uses pnacl-clang from the NaCl SDK for the tests, while crosstest.py uses clang/clang++ from LLVM_BIN_PATH for the driver. The SDK has been updated to use a different version of the standard library, and now there is a mismatch as to whether int8_t is typedef'd to 'char' or 'signed char', leading to name mangling mismatches. (char, signed char, and unsigned char are distinct types.) We deal with this by using myint8_t which is explicitly defined as signed char. 2. Some ugly function pointer casting in test_arith_main.cpp is fixed/removed. 3. std::endl is replaced with "\n". 4. License text is added to tests that were touched by the above items. BUG= none R=wala@chromium.org Review URL: https://codereview.chromium.org/435353002
parent e377767c
//===- subzero/crosstest/test_arith.cpp - Arithmetic operator tests -------===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Implementation for crosstesting arithmetic operations.
//
//===----------------------------------------------------------------------===//
// This aims to test all the arithmetic bitcode instructions across
// all PNaCl primitive data types.
......@@ -19,7 +32,7 @@ UINTOP_TABLE
#define X(inst, op, isdiv) \
bool test##inst(bool a, bool b) { return a op b; } \
int8_t test##inst(int8_t a, int8_t b) { return a op b; } \
myint8_t test##inst(myint8_t a, myint8_t b) { return a op b; } \
int16_t test##inst(int16_t a, int16_t b) { return a op b; } \
int32_t test##inst(int32_t a, int32_t b) { return a op b; } \
int64_t test##inst(int64_t a, int64_t b) { return a op b; } \
......
//===- subzero/crosstest/test_arith.def - macros for tests ----*- C++ -*---===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines macros for crosstesting arithmetic operations.
//
//===----------------------------------------------------------------------===//
#ifndef TEST_ARITH_DEF
#define TEST_ARITH_DEF
......
......@@ -31,7 +31,7 @@ UINTOP_TABLE
#define X(inst, op, isdiv) \
bool test##inst(bool a, bool b); \
int8_t test##inst(int8_t a, int8_t b); \
myint8_t test##inst(myint8_t a, myint8_t b); \
int16_t test##inst(int16_t a, int16_t b); \
int32_t test##inst(int32_t a, int32_t b); \
int64_t test##inst(int64_t a, int64_t b); \
......
......@@ -50,24 +50,24 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
volatile unsigned Values[] = INT_VALUE_ARRAY;
const static size_t NumValues = sizeof(Values) / sizeof(*Values);
static struct {
// For functions that operate on unsigned values, the
// FuncLlcSigned and FuncSzSigned fields are NULL. For functions
// that operate on signed values, the FuncLlcUnsigned and
// FuncSzUnsigned fields are NULL.
const char *Name;
FuncTypeUnsigned FuncLlc;
FuncTypeUnsigned FuncSz;
FuncTypeUnsigned FuncLlcUnsigned;
FuncTypeUnsigned FuncSzUnsigned;
FuncTypeSigned FuncLlcSigned;
FuncTypeSigned FuncSzSigned;
bool ExcludeDivExceptions; // for divide related tests
} Funcs[] = {
#define X(inst, op, isdiv) \
{ \
STR(inst), (FuncTypeUnsigned)test##inst, \
(FuncTypeUnsigned)Subzero_::test##inst, isdiv \
} \
{ STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv } \
,
UINTOP_TABLE
#undef X
#define X(inst, op, isdiv) \
{ \
STR(inst), (FuncTypeUnsigned)(FuncTypeSigned)test##inst, \
(FuncTypeUnsigned)(FuncTypeSigned)Subzero_::test##inst, isdiv \
} \
{ STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv } \
,
SINTOP_TABLE
#undef X
......@@ -87,8 +87,14 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
inputsMayTriggerException<TypeSigned>(Value1, Value2))
continue;
++TotalTests;
TypeUnsigned ResultSz = Funcs[f].FuncSz(Value1, Value2);
TypeUnsigned ResultLlc = Funcs[f].FuncLlc(Value1, Value2);
TypeUnsigned ResultSz, ResultLlc;
if (Funcs[f].FuncSzUnsigned) {
ResultSz = Funcs[f].FuncSzUnsigned(Value1, Value2);
ResultLlc = Funcs[f].FuncLlcUnsigned(Value1, Value2);
} else {
ResultSz = Funcs[f].FuncSzSigned(Value1, Value2);
ResultLlc = Funcs[f].FuncLlcSigned(Value1, Value2);
}
if (ResultSz == ResultLlc) {
++Passes;
} else {
......@@ -96,7 +102,7 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
std::cout << "test" << Funcs[f].Name
<< (CHAR_BIT * sizeof(TypeUnsigned)) << "(" << Value1
<< ", " << Value2 << "): sz=" << (unsigned)ResultSz
<< " llc=" << (unsigned)ResultLlc << std::endl;
<< " llc=" << (unsigned)ResultLlc << "\n";
}
}
}
......@@ -117,8 +123,14 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
inputsMayTriggerException<TypeSigned>(Value1, Value2))
continue;
++TotalTests;
TypeUnsigned ResultSz = Funcs[f].FuncSz(Value1, Value2);
TypeUnsigned ResultLlc = Funcs[f].FuncLlc(Value1, Value2);
TypeUnsigned ResultSz, ResultLlc;
if (Funcs[f].FuncSzUnsigned) {
ResultSz = Funcs[f].FuncSzUnsigned(Value1, Value2);
ResultLlc = Funcs[f].FuncLlcUnsigned(Value1, Value2);
} else {
ResultSz = Funcs[f].FuncSzSigned(Value1, Value2);
ResultLlc = Funcs[f].FuncLlcSigned(Value1, Value2);
}
if (ResultSz == ResultLlc) {
++Passes;
} else {
......@@ -126,7 +138,7 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
std::cout << "test" << Funcs[f].Name
<< (CHAR_BIT * sizeof(TypeUnsigned)) << "(" << Value1
<< ", " << Value2 << "): sz=" << (unsigned)ResultSz
<< " llc=" << (unsigned)ResultLlc << std::endl;
<< " llc=" << (unsigned)ResultLlc << "\n";
}
}
}
......@@ -150,23 +162,27 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
volatile unsigned Values[] = INT_VALUE_ARRAY;
const static size_t NumValues = sizeof(Values) / sizeof(*Values);
static struct {
// For functions that operate on unsigned values, the
// FuncLlcSigned and FuncSzSigned fields are NULL. For functions
// that operate on signed values, the FuncLlcUnsigned and
// FuncSzUnsigned fields are NULL.
const char *Name;
FuncTypeUnsigned FuncLlc;
FuncTypeUnsigned FuncSz;
FuncTypeUnsigned FuncLlcUnsigned;
FuncTypeUnsigned FuncSzUnsigned;
FuncTypeSigned FuncLlcSigned;
FuncTypeSigned FuncSzSigned;
bool ExcludeDivExceptions; // for divide related tests
} Funcs[] = {
#define X(inst, op, isdiv) \
{ \
STR(inst), (FuncTypeUnsigned)test##inst, \
(FuncTypeUnsigned)Subzero_::test##inst, isdiv \
STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv \
} \
,
UINTOP_TABLE
#undef X
#define X(inst, op, isdiv) \
{ \
STR(inst), (FuncTypeUnsigned)(FuncTypeSigned)test##inst, \
(FuncTypeUnsigned)(FuncTypeSigned)Subzero_::test##inst, isdiv \
STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv \
} \
,
SINTOP_TABLE
......@@ -190,9 +206,15 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
++j;
}
// Perform the test.
TypeUnsigned ResultSz = Funcs[f].FuncSz(Value1, Value2);
TypeUnsigned ResultLlc = Funcs[f].FuncLlc(Value1, Value2);
TypeUnsigned ResultSz, ResultLlc;
++TotalTests;
if (Funcs[f].FuncSzUnsigned) {
ResultSz = Funcs[f].FuncSzUnsigned(Value1, Value2);
ResultLlc = Funcs[f].FuncLlcUnsigned(Value1, Value2);
} else {
ResultSz = Funcs[f].FuncSzSigned(Value1, Value2);
ResultLlc = Funcs[f].FuncLlcSigned(Value1, Value2);
}
if (!memcmp(&ResultSz, &ResultLlc, sizeof(ResultSz))) {
++Passes;
} else {
......@@ -203,7 +225,7 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
<< vectAsString<TypeUnsignedLabel>(Value2)
<< "): sz=" << vectAsString<TypeUnsignedLabel>(ResultSz)
<< " llc=" << vectAsString<TypeUnsignedLabel>(ResultLlc)
<< std::endl;
<< "\n";
}
}
}
......@@ -247,7 +269,7 @@ void testsFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
std::cout << std::fixed << "test" << Funcs[f].Name
<< (CHAR_BIT * sizeof(Type)) << "(" << Value1 << ", "
<< Value2 << "): sz=" << ResultSz << " llc=" << ResultLlc
<< std::endl;
<< "\n";
}
}
}
......@@ -264,7 +286,7 @@ void testsFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
++Failures;
std::cout << std::fixed << "test_sqrt" << (CHAR_BIT * sizeof(Type)) << "("
<< Value << "): sz=" << ResultSz << " llc=" << ResultLlc
<< std::endl;
<< "\n";
}
}
}
......@@ -311,7 +333,7 @@ void testsVecFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
<< "(" << vectAsString<v4f32>(Value1) << ","
<< vectAsString<v4f32>(Value2)
<< "): sz=" << vectAsString<v4f32>(ResultSz) << " llc"
<< vectAsString<v4f32>(ResultLlc) << std::endl;
<< vectAsString<v4f32>(ResultLlc) << "\n";
}
}
}
......@@ -322,7 +344,7 @@ int main(int argc, char **argv) {
size_t Passes = 0;
size_t Failures = 0;
testsInt<uint8_t, int8_t>(TotalTests, Passes, Failures);
testsInt<uint8_t, myint8_t>(TotalTests, Passes, Failures);
testsInt<uint16_t, int16_t>(TotalTests, Passes, Failures);
testsInt<uint32_t, int32_t>(TotalTests, Passes, Failures);
testsInt<uint64_t, int64_t>(TotalTests, Passes, Failures);
......
//===- subzero/crosstest/test_cast.cpp - Cast operator tests --------------===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Implementation for crosstesting cast operations.
//
//===----------------------------------------------------------------------===//
// This aims to test all the conversion bitcode instructions across
// all PNaCl primitive data types.
......@@ -19,7 +32,7 @@ ToType __attribute__((noinline)) castBits(FromType a) {
// all <A,B>, so that they can be called from the driver.
template <typename ToType> class Caster {
static ToType f(bool a) { return cast<bool, ToType>(a); }
static ToType f(int8_t a) { return cast<int8_t, ToType>(a); }
static ToType f(myint8_t a) { return cast<myint8_t, ToType>(a); }
static ToType f(uint8_t a) { return cast<uint8_t, ToType>(a); }
static ToType f(int16_t a) { return cast<int16_t, ToType>(a); }
static ToType f(uint16_t a) { return cast<uint16_t, ToType>(a); }
......@@ -37,7 +50,7 @@ template <typename ToType> class Caster {
// template class Caster<bool>;
template class Caster<int8_t>;
template class Caster<myint8_t>;
template class Caster<uint8_t>;
template class Caster<int16_t>;
template class Caster<uint16_t>;
......
//===- subzero/crosstest/test_cast.h - Test prototypes ----------*- C++ -*-===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the function prototypes used for crosstesting cast
// operations.
//
//===----------------------------------------------------------------------===//
// The driver and the test program may be compiled by different
// versions of clang, with different standard libraries that have
// different definitions of int8_t. Specifically, int8_t may be
// typedef'd as either 'char' or 'signed char', which mangle to
// different strings. Avoid int8_t and use an explicit myint8_t.
typedef signed char myint8_t;
template <typename FromType, typename ToType> ToType cast(FromType a);
template <typename FromType, typename ToType> ToType castBits(FromType a);
//===- subzero/crosstest/test_cast_main.cpp - Driver for tests ------------===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Driver for crosstesting cast operations.
//
//===----------------------------------------------------------------------===//
/* crosstest.py --test=test_cast.cpp --test=test_cast_to_u1.ll \
--driver=test_cast_main.cpp --prefix=Subzero_ --output=test_cast */
......@@ -36,7 +49,7 @@ void testValue(FromType Val, size_t &TotalTests, size_t &Passes,
size_t &Failures) {
COMPARE(cast, FromType, bool, Val);
COMPARE(cast, FromType, uint8_t, Val);
COMPARE(cast, FromType, int8_t, Val);
COMPARE(cast, FromType, myint8_t, Val);
COMPARE(cast, FromType, uint16_t, Val);
COMPARE(cast, FromType, int16_t, Val);
COMPARE(cast, FromType, uint32_t, Val);
......@@ -57,7 +70,7 @@ int main(int argc, char **argv) {
volatile uint8_t ValsUi8[] = { 0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff };
static const size_t NumValsUi8 = sizeof(ValsUi8) / sizeof(*ValsUi8);
volatile int8_t ValsSi8[] = { 0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff };
volatile myint8_t ValsSi8[] = { 0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff };
static const size_t NumValsSi8 = sizeof(ValsSi8) / sizeof(*ValsSi8);
volatile uint16_t ValsUi16[] = { 0, 1, 0x7e, 0x7f, 0x80,
......@@ -151,8 +164,8 @@ int main(int argc, char **argv) {
testValue<uint8_t>(Val, TotalTests, Passes, Failures);
}
for (size_t i = 0; i < NumValsSi8; ++i) {
int8_t Val = ValsSi8[i];
testValue<int8_t>(Val, TotalTests, Passes, Failures);
myint8_t Val = ValsSi8[i];
testValue<myint8_t>(Val, TotalTests, Passes, Failures);
}
for (size_t i = 0; i < NumValsUi16; ++i) {
uint16_t Val = ValsUi16[i];
......
//===- subzero/crosstest/test_fcmp.def - macros for tests -----*- C++ -*---===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines macros for crosstesting the fcmp instruction.
//
//===----------------------------------------------------------------------===//
#ifndef TEST_FCMP_DEF
#define TEST_FCMP_DEF
......
//===- subzero/crosstest/test_global.cpp - Global variable access tests ---===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Implementation for crosstesting global variable access operations.
//
//===----------------------------------------------------------------------===//
#include <stdint.h>
#include <cstdlib>
......
//===- subzero/crosstest/test_global.h - Test prototypes --------*- C++ -*-===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the function prototypes used for crosstesting global
// variable access operations.
//
//===----------------------------------------------------------------------===//
// The driver and the test program may be compiled by different
// versions of clang, with different standard libraries that have
// different definitions of int8_t. Specifically, int8_t may be
// typedef'd as either 'char' or 'signed char', which mangle to
// different strings. Avoid int8_t and use an explicit myint8_t.
typedef signed char myint8_t;
size_t getNumArrays();
const uint8_t *getArray(size_t WhichArray, size_t &Len);
//===- subzero/crosstest/test_global_main.cpp - Driver for tests ----------===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Driver for crosstesting global variable access operations.
//
//===----------------------------------------------------------------------===//
/* crosstest.py --test=test_global.cpp \
--driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */
......@@ -29,7 +42,7 @@ int main(int argc, char **argv) {
++Passes;
} else {
std::cout << i << ":LlcArrayLen=" << LlcArrayLen
<< ", SzArrayLen=" << SzArrayLen << std::endl;
<< ", SzArrayLen=" << SzArrayLen << "\n";
++Failures;
}
......@@ -41,7 +54,7 @@ int main(int argc, char **argv) {
++Failures;
std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i]
<< ", SzArray[" << i << "] = " << (int)SzArray[i]
<< std::endl;
<< "\n";
}
}
}
......
......@@ -28,7 +28,7 @@ ICMP_U_TABLE
#undef X
#define X(cmp, op) \
bool icmp##cmp(int8_t a, int8_t b) { return a op b; } \
bool icmp##cmp(myint8_t a, myint8_t b) { return a op b; } \
bool icmp##cmp(int16_t a, int16_t b) { return a op b; } \
bool icmp##cmp(int32_t a, int32_t b) { return a op b; } \
bool icmp##cmp(int64_t a, int64_t b) { return a op b; } \
......
//===- subzero/crosstest/test_icmp.def - macros for tests -----*- C++ -*---===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines macros for crosstesting the icmp instruction.
//
//===----------------------------------------------------------------------===//
#ifndef TEST_ICMP_DEF
#define TEST_ICMP_DEF
......
......@@ -28,7 +28,7 @@ ICMP_U_TABLE
#undef X
#define X(cmp, op) \
bool icmp##cmp(int8_t a, int8_t b); \
bool icmp##cmp(myint8_t a, myint8_t b); \
bool icmp##cmp(int16_t a, int16_t b); \
bool icmp##cmp(int32_t a, int32_t b); \
bool icmp##cmp(int64_t a, int64_t b); \
......
......@@ -81,7 +81,7 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
std::cout << "icmp" << Funcs[f].Name
<< (CHAR_BIT * sizeof(TypeUnsigned)) << "(" << Value1
<< ", " << Value2 << "): sz=" << ResultSz
<< " llc=" << ResultLlc << std::endl;
<< " llc=" << ResultLlc << "\n";
}
}
}
......@@ -108,7 +108,7 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
std::cout << "icmp" << Funcs[f].Name
<< (CHAR_BIT * sizeof(TypeUnsigned)) << "(" << Value1
<< ", " << Value2 << "): sz=" << ResultSz
<< " llc=" << ResultLlc << std::endl;
<< " llc=" << ResultLlc << "\n";
}
}
}
......@@ -174,7 +174,7 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
<< vectAsString<TypeUnsignedLabel>(Value2)
<< "): sz=" << vectAsString<TypeUnsignedLabel>(ResultSz)
<< " llc=" << vectAsString<TypeUnsignedLabel>(ResultLlc)
<< std::endl;
<< "\n";
}
}
}
......@@ -234,7 +234,7 @@ void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) {
<< vectAsString<T>(Value1) << ","
<< vectAsString<T>(Value2)
<< "): sz=" << vectAsString<T>(ResultSz)
<< " llc=" << vectAsString<T>(ResultLlc) << std::endl;
<< " llc=" << vectAsString<T>(ResultLlc) << "\n";
}
}
}
......@@ -260,7 +260,7 @@ void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) {
std::cout << "test" << Funcs[f].Name << Vectors<T>::TypeName << "("
<< vectAsString<T>(Value1) << "," << vectAsString<T>(Value2)
<< "): sz=" << vectAsString<T>(ResultSz)
<< " llc=" << vectAsString<T>(ResultLlc) << std::endl;
<< " llc=" << vectAsString<T>(ResultLlc) << "\n";
}
}
}
......@@ -272,7 +272,7 @@ int main(int argc, char **argv) {
size_t Passes = 0;
size_t Failures = 0;
testsInt<uint8_t, int8_t>(TotalTests, Passes, Failures);
testsInt<uint8_t, myint8_t>(TotalTests, Passes, Failures);
testsInt<uint16_t, int16_t>(TotalTests, Passes, Failures);
testsInt<uint32_t, int32_t>(TotalTests, Passes, Failures);
testsInt<uint64_t, int64_t>(TotalTests, Passes, Failures);
......
//===- subzero/crosstest/test_vector_ops.def - test macros ----*- C++ -*---===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines macros for crosstesting the insertelement and
// extractelement instruction.
//
//===----------------------------------------------------------------------===//
#ifndef TEST_VECTOR_OPS_DEF
#define VECTOR_TYPE_TABLE \
......
......@@ -53,7 +53,7 @@ typename VectorOps<T>::Ty *getTestVectors(size_t &NumTestVectors) {
const size_t VECTOR_ALIGNMENT = 16;
void *Dest;
if (posix_memalign(&Dest, VECTOR_ALIGNMENT, sizeof(TestVectors))) {
std::cerr << "memory allocation error" << std::endl;
std::cerr << "memory allocation error\n";
abort();
}
......@@ -89,9 +89,9 @@ void testInsertElement(size_t &TotalTests, size_t &Passes, size_t &Failures) {
std::cout << "insertelement<" << VectorOps<T>::TypeName << ">(Vect=";
std::cout << vectAsString<T>(Vect)
<< ", Element=" << (typename VectorOps<T>::CastTy)Elt
<< ", Pos=" << I << ")" << std::endl;
std::cout << "llc=" << vectAsString<T>(ResultLlc) << std::endl;
std::cout << "sz =" << vectAsString<T>(ResultSz) << std::endl;
<< ", Pos=" << I << ")\n";
std::cout << "llc=" << vectAsString<T>(ResultLlc) << "\n";
std::cout << "sz =" << vectAsString<T>(ResultSz) << "\n";
}
}
}
......@@ -120,9 +120,9 @@ void testExtractElement(size_t &TotalTests, size_t &Passes, size_t &Failures) {
} else {
++Failures;
std::cout << "extractelement<" << VectorOps<T>::TypeName << ">(Vect=";
std::cout << vectAsString<T>(Vect) << ", Pos=" << I << ")" << std::endl;
std::cout << "llc=" << ResultLlc << std::endl;
std::cout << "sz =" << ResultSz << std::endl;
std::cout << vectAsString<T>(Vect) << ", Pos=" << I << ")\n";
std::cout << "llc=" << ResultLlc << "\n";
std::cout << "sz =" << ResultSz << "\n";
}
}
}
......@@ -166,7 +166,7 @@ int main(int argc, char *argv[]) {
extern "C" {
void ice_unreachable(void) {
std::cerr << "\"unreachable\" instruction encountered" << std::endl;
std::cerr << "\"unreachable\" instruction encountered\n";
abort();
}
}
......@@ -16,7 +16,7 @@
#define VECTOR_TYPE_TABLE \
/* typename, element type, cast type */ \
X(v16si8, int8_t, int64_t) \
X(v16si8, myint8_t, int64_t) \
X(v16ui8, uint8_t, int64_t) \
X(v8si16, int16_t, int64_t) \
X(v8ui16, uint16_t, int64_t) \
......
......@@ -20,6 +20,13 @@
#include <string>
#include <sstream>
// The driver and the test program may be compiled by different
// versions of clang, with different standard libraries that have
// different definitions of int8_t. Specifically, int8_t may be
// typedef'd as either 'char' or 'signed char', which mangle to
// different strings. Avoid int8_t and use an explicit myint8_t.
typedef signed char myint8_t;
#include "vectors.def"
// PNaCl portable vector types
......
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