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