1 /* debuginfo tests for combinations of const and volatile type qualifiers. */
3 /* { dg-options "-g" } */
5 int i
__attribute__((used
));
6 const int ci
__attribute__((used
));
8 const volatile int cvi
;
10 int *pi
__attribute__((used
));
11 const int *pci
__attribute__((used
));
12 volatile int *pvi
__attribute__((used
));
13 const volatile int *pcvi
__attribute__((used
));
15 int * const cip
__attribute__((used
));
17 int * const volatile cvip
;
22 const signed char csc
;
28 const signed char csc
;
36 const volatile short cvs
;
37 volatile long long vll
;
40 struct bar bar
__attribute__((used
));
41 struct foo foo
__attribute__((used
));
42 const struct foo cfoo
__attribute__((used
));
43 volatile struct foo vfoo
;
44 const volatile struct foo cvfoo
;
46 typedef volatile signed char score
;
51 static __attribute__((noclone
, noinline
)) int
52 f (const char *progname
, volatile struct foo
*dummy
, const score s
)
54 return progname
== 0 || dummy
== 0 || dummy
->csc
== s
;
58 main (int argc
, char **argv
)
61 struct foo dummy
= { 1, 1 };
62 return f (argv
[0], &dummy
, as
) - 1;
65 /* { dg-final { gdb-test 50 "type:main" "int (int, char **)" } } */
67 /* { dg-final { gdb-test 50 "type:i" "int" } } */
68 /* { dg-final { gdb-test 50 "type:ci" "const int" } } */
69 /* { dg-final { gdb-test 50 "type:vi" "volatile int" } } */
70 /* { dg-final { gdb-test 50 "type:cvi" "const volatile int" } } */
72 /* { dg-final { gdb-test 50 "type:pi" "int *" } } */
73 /* { dg-final { gdb-test 50 "type:pci" "const int *" } } */
74 /* { dg-final { gdb-test 50 "type:pvi" "volatile int *" } } */
75 /* { dg-final { gdb-test 50 "type:pcvi" "const volatile int *" } } */
77 /* { dg-final { gdb-test 50 "type:cip" "int * const" } } */
78 /* { dg-final { gdb-test 50 "type:vip" "int * volatile" } } */
79 /* { dg-final { gdb-test 50 "type:cvip" "int * const volatile" } } */
81 /* { dg-final { gdb-test 50 "type:vs" "volatile struct { const long cli; const signed char csc; }" } } */
83 /* { dg-final { gdb-test 50 "type:cvip" "int * const volatile" } } */
85 /* { dg-final { gdb-test 50 "type:bar" "struct bar { short s; const short cs; volatile short vs; const volatile short cvs; volatile long long vll; }" } } */
86 /* { dg-final { gdb-test 50 "type:foo" "struct foo { const long cli; const signed char csc; }" } } */
87 /* { dg-final { gdb-test 50 "type:cfoo" "const struct foo { const long cli; const signed char csc; }" } } */
88 /* { dg-final { gdb-test 50 "type:vfoo" "volatile struct foo { const long cli; const signed char csc; }" } } */
89 /* { dg-final { gdb-test 50 "type:cvfoo" "const volatile struct foo { const long cli; const signed char csc; }" } } */
91 /* { dg-final { gdb-test 58 "type:s" "volatile signed char" } } */
92 /* { dg-final { gdb-test 50 "type:cs" "const volatile signed char" } } */
94 /* { dg-final { gdb-test 50 "type:f" "int (const char *, volatile struct foo *, const score)" } } */