Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
0002 
0003 /*
0004  * BTF-to-C dumper test for topological sorting of dependent structs.
0005  *
0006  * Copyright (c) 2019 Facebook
0007  */
0008 /* ----- START-EXPECTED-OUTPUT ----- */
0009 struct s1 {};
0010 
0011 struct s3;
0012 
0013 struct s4;
0014 
0015 struct s2 {
0016     struct s2 *s2;
0017     struct s3 *s3;
0018     struct s4 *s4;
0019 };
0020 
0021 struct s3 {
0022     struct s1 s1;
0023     struct s2 s2;
0024 };
0025 
0026 struct s4 {
0027     struct s1 s1;
0028     struct s3 s3;
0029 };
0030 
0031 struct list_head {
0032     struct list_head *next;
0033     struct list_head *prev;
0034 };
0035 
0036 struct hlist_node {
0037     struct hlist_node *next;
0038     struct hlist_node **pprev;
0039 };
0040 
0041 struct hlist_head {
0042     struct hlist_node *first;
0043 };
0044 
0045 struct callback_head {
0046     struct callback_head *next;
0047     void (*func)(struct callback_head *);
0048 };
0049 
0050 struct root_struct {
0051     struct s4 s4;
0052     struct list_head l;
0053     struct hlist_node n;
0054     struct hlist_head h;
0055     struct callback_head cb;
0056 };
0057 
0058 /*------ END-EXPECTED-OUTPUT ------ */
0059 
0060 int f(struct root_struct *root)
0061 {
0062     return 0;
0063 }