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 validating no name versioning happens between
0005  * independent C namespaces (struct/union/enum vs typedef/enum values).
0006  *
0007  * Copyright (c) 2019 Facebook
0008  */
0009 /* ----- START-EXPECTED-OUTPUT ----- */
0010 struct S {
0011     int S;
0012     int U;
0013 };
0014 
0015 typedef struct S S;
0016 
0017 union U {
0018     int S;
0019     int U;
0020 };
0021 
0022 typedef union U U;
0023 
0024 enum E {
0025     V = 0,
0026 };
0027 
0028 typedef enum E E;
0029 
0030 struct A {};
0031 
0032 union B {};
0033 
0034 enum C {
0035     A = 1,
0036     B = 2,
0037     C = 3,
0038 };
0039 
0040 struct X {};
0041 
0042 union Y {};
0043 
0044 enum Z;
0045 
0046 typedef int X;
0047 
0048 typedef int Y;
0049 
0050 typedef int Z;
0051 
0052 /*------ END-EXPECTED-OUTPUT ------ */
0053 
0054 int f(struct {
0055     struct S _1;
0056     S _2;
0057     union U _3;
0058     U _4;
0059     enum E _5;
0060     E _6;
0061     struct A a;
0062     union B b;
0063     enum C c;
0064     struct X x;
0065     union Y y;
0066     enum Z *z;
0067     X xx;
0068     Y yy;
0069     Z zz;
0070 } *_)
0071 {
0072     return 0;
0073 }