aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-declextract/testdata/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/syz-declextract/testdata/functions.c')
-rw-r--r--tools/syz-declextract/testdata/functions.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/tools/syz-declextract/testdata/functions.c b/tools/syz-declextract/testdata/functions.c
index 30e544702..0ae312d44 100644
--- a/tools/syz-declextract/testdata/functions.c
+++ b/tools/syz-declextract/testdata/functions.c
@@ -2,17 +2,20 @@
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
#include "include/fs.h"
-#include "include/types.h"
#include "include/syscall.h"
+#include "include/types.h"
-static void func_foo() {
+static void func_foo()
+{
}
-static void func_bar() {
+static void func_bar()
+{
func_foo();
}
-int func_baz(int f) {
+int func_baz(int f)
+{
func_foo();
if (f)
func_bar();
@@ -23,30 +26,34 @@ int func_baz(int f) {
return alloc_fd();
}
-int func_qux() {
+int func_qux()
+{
int fd = alloc_fd();
return fd;
}
-SYSCALL_DEFINE1(functions, long x) {
+SYSCALL_DEFINE1(functions, long x)
+{
__fget_light(x);
return func_baz(1);
}
struct Typed {
- int a;
- int b;
- int c;
+ int a;
+ int b;
+ int c;
};
-int typing1(int a, int b) {
- return a;
+int typing1(int a, int b)
+{
+ return a;
}
-int typing(struct Typed* t1, int i) {
- struct Typed t2;
- t2.a = t1->b;
- int l = typing1(i, t2.a);
- t1->c = l;
- return l;
+int typing(struct Typed* t1, int i)
+{
+ struct Typed t2;
+ t2.a = t1->b;
+ int l = typing1(i, t2.a);
+ t1->c = l;
+ return l;
}