1 # Copyright © 2021 Nick Bowler
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 AT_BANNER([Internal library behaviour])
18 AT_SETUP([cdecl__normalize_specs])
20 TEST_NEED_PROGRAM([normalize])
22 # Note that not all combinations of specifiers make a specifier list that can
23 # appear in a valid C declaration. We don't want to test normalization of
24 # invalid specifier lists: each line in the below input file is a specifier
25 # list that is possible to use.
27 [[int long signed long
28 long int long unsigned
35 _Imaginary double long
38 const struct foo volatile restrict restrict const volatile const restrict
39 volatile const const restrict union bar restrict volatile volatile const
40 const const volatile volatile restrict restrict volatile enum baz volatile
42 int signed long const volatile inline static
43 short inline int extern volatile unsigned const
44 _Complex volatile double const long typedef
45 long const _Imaginary double register volatile
46 volatile _Bool const auto
49 AT_CHECK([normalize -f input], [0], [[signed long long int
50 unsigned long long int
57 long double _Imaginary
60 restrict volatile const struct foo
61 restrict volatile const union bar
62 restrict volatile const enum baz
64 static inline volatile const signed long int
65 extern inline volatile const unsigned short int
66 typedef volatile const long double _Complex
67 register volatile const long double _Imaginary
68 auto volatile const _Bool