aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/macro-issue1233.rs
blob: 7fab787b9e8dcf54b1dca34dc243944335bedc90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-additional-options "-frust-cfg=A -w" }

macro_rules! impl_uint {
    ($($ty:ident = $lang:literal),*) => {
        $(
            impl $ty {
                pub fn to_le(self) -> Self {
                    #[cfg(not(A))]
                    {
                        self
                    }
                    #[cfg(A)]
                    {
                        self
                    }
                }
            }
        )*
    }
}

impl_uint!(u8 = "u8", u16 = "u16", u32 = "u32");