Module Name: src
Committed By: rillig
Date: Sun Feb 13 12:04:37 UTC 2022
Modified Files:
src/tests/usr.bin/indent: lsym_lparen_or_lbracket.c
Log Message:
tests/indent: test token '('
There are already some tests in token_lparen.c that need to be merged.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c
diff -u src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c:1.2 src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c:1.3
--- src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c:1.2 Sun Feb 13 11:07:48 2022
+++ src/tests/usr.bin/indent/lsym_lparen_or_lbracket.c Sun Feb 13 12:04:37 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_lparen_or_lbracket.c,v 1.2 2022/02/13 11:07:48 rillig Exp $ */
+/* $NetBSD: lsym_lparen_or_lbracket.c,v 1.3 2022/02/13 12:04:37 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -21,8 +21,26 @@
* In an expression, '(' followed by a type name starts a cast expression.
*/
+// TODO: Add systematic tests for all cases.
+
#indent input
-// TODO: add input
+void
+function(void)
+{
+ /* Type casts */
+ a = (int)b;
+ a = (struct tag)b;
+ /* TODO: The '(int)' is not a type cast, it is a prototype list. */
+ a = (int (*)(int))fn;
+
+ /* Not type casts */
+ a = sizeof(int) * 2;
+ a = sizeof(5) * 2;
+ a = offsetof(struct stat, st_mtime);
+
+ /* Grouping subexpressions */
+ a = ((((b + c)))) * d;
+}
#indent end
#indent run-equals-input