aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-12-05 04:40:14 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-12-13 09:17:06 +0530
commit4967b2a5ea0a67f6229a2dd0ea3d08fd93650061 (patch)
tree4e2a433caf5212d828851d3df8679e531cc3a6cf
parent5240688f5c591fed013057f2ef437dde58f0b504 (diff)
downloadmeson-4967b2a5ea0a67f6229a2dd0ea3d08fd93650061.zip
meson-4967b2a5ea0a67f6229a2dd0ea3d08fd93650061.tar.gz
meson-4967b2a5ea0a67f6229a2dd0ea3d08fd93650061.tar.bz2
tests/common/124: Print an error when square fails
Otherwise we can't know why it failed and that makes it harder to debug.
-rw-r--r--test cases/common/126 llvm ir and assembly/main.c9
-rw-r--r--test cases/common/126 llvm ir and assembly/main.cpp8
2 files changed, 13 insertions, 4 deletions
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 edfb29e..97fe723 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 <stdio.h>
+
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 4f576e7..f2c7de3 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 <stdio.h>
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;
}