opt_cs.c revision 1.5
1/* $NetBSD: opt_cs.c,v 1.5 2022/04/22 21:21:20 rillig Exp $ */
2
3/*
4 * Tests for the options '-cs' and '-ncs'.
5 *
6 * The option '-cs' forces a space after the parentheses of a cast.
7 *
8 * The option '-ncs' removes all whitespace after the parentheses of a cast.
9 */
10
11#indent input
12int		i0 = (int)3.0;
13int		i1 = (int) 3.0;
14int		i3 = (int)   3.0;
15#indent end
16
17#indent run -cs
18int		i0 = (int) 3.0;
19int		i1 = (int) 3.0;
20int		i3 = (int) 3.0;
21#indent end
22
23#indent run -ncs
24int		i0 = (int)3.0;
25int		i1 = (int)3.0;
26int		i3 = (int)3.0;
27#indent end
28
29
30#indent input
31struct s	s3 = (struct s)   s;
32struct s       *ptr = (struct s *)   s;
33union u		u3 = (union u)   u;
34enum e		e3 = (enum e)   e;
35#indent end
36
37#indent run -cs
38struct s	s3 = (struct s) s;
39struct s       *ptr = (struct s *) s;
40union u		u3 = (union u) u;
41enum e		e3 = (enum e) e;
42#indent end
43
44#indent run -ncs
45struct s	s3 = (struct s)s;
46struct s       *ptr = (struct s *)s;
47union u		u3 = (union u)u;
48enum e		e3 = (enum e)e;
49#indent end
50