[PATCH] testsuite: fix missing return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some non-void functions in the testcases miss a return.

Add the missing return or make the function as returning void.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/linear/call-basic.c | 16 ++++++++--------
 validation/optim/dup-cond0.c   |  1 +
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/validation/linear/call-basic.c b/validation/linear/call-basic.c
index 60517e2e3..46eab1081 100644
--- a/validation/linear/call-basic.c
+++ b/validation/linear/call-basic.c
@@ -1,21 +1,21 @@
 extern int fun(int a);
 
-int symbol(int a)
+void symbol(int a)
 {
 	fun(a);
 }
 
-int pointer0(int a, int (*fun)(int))
+void pointer0(int a, int (*fun)(int))
 {
 	fun(a);
 }
 
-int pointer1(int a, int (*fun)(int))
+void pointer1(int a, int (*fun)(int))
 {
 	(*fun)(a);
 }
 
-int builtin(int a)
+void builtin(int a)
 {
 	__builtin_popcount(a);
 }
@@ -29,28 +29,28 @@ symbol:
 .L0:
 	<entry-point>
 	call.32     %r2 <- fun, %arg1
-	ret.32      %r2
+	ret
 
 
 pointer0:
 .L2:
 	<entry-point>
 	call.32     %r5 <- %arg2, %arg1
-	ret.32      %r5
+	ret
 
 
 pointer1:
 .L4:
 	<entry-point>
 	call.32     %r8 <- %arg2, %arg1
-	ret.32      %r8
+	ret
 
 
 builtin:
 .L6:
 	<entry-point>
 	call.32     %r11 <- __builtin_popcount, %arg1
-	ret.32      %r11
+	ret
 
 
  * check-output-end
diff --git a/validation/optim/dup-cond0.c b/validation/optim/dup-cond0.c
index 0525250c7..26af43852 100644
--- a/validation/optim/dup-cond0.c
+++ b/validation/optim/dup-cond0.c
@@ -8,6 +8,7 @@ static int foo(struct s *s)
 		return 0;
 	else if (!s->f)
 		return 4;
+	return -1;
 }
 
 /*
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux