From 4967b2a5ea0a67f6229a2dd0ea3d08fd93650061 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 5 Dec 2016 04:40:14 +0530 Subject: tests/common/124: Print an error when square fails Otherwise we can't know why it failed and that makes it harder to debug. --- test cases/common/126 llvm ir and assembly/main.c | 9 +++++++-- test cases/common/126 llvm ir and assembly/main.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'test cases') diff --git a/test cases/common/126 llvm ir and assembly/main.c b/test cases/common/126 llvm ir and assembly/main.c index edfb29ecf..97fe723e3 100644 --- a/test cases/common/126 llvm ir and assembly/main.c +++ b/test cases/common/126 llvm ir and assembly/main.c @@ -1,9 +1,14 @@ +#include + unsigned square_unsigned (unsigned a); int main (int argc, char * argv[]) { - if (square_unsigned (2) != 4) - return -1; + unsigned int ret = square_unsigned (2); + if (ret != 4) { + printf("Got %u instead of 4\n", ret); + return 1; + } return 0; } diff --git a/test cases/common/126 llvm ir and assembly/main.cpp b/test cases/common/126 llvm ir and assembly/main.cpp index 4f576e7ed..f2c7de36c 100644 --- a/test cases/common/126 llvm ir and assembly/main.cpp +++ b/test cases/common/126 llvm ir and assembly/main.cpp @@ -1,3 +1,4 @@ +#include extern "C" { unsigned square_unsigned (unsigned a); @@ -6,7 +7,10 @@ extern "C" { int main (int argc, char * argv[]) { - if (square_unsigned (2) != 4) - return -1; + unsigned int ret = square_unsigned (2); + if (ret != 4) { + printf("Got %u instead of 4\n", ret); + return 1; + } return 0; } -- cgit v1.2.3