Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: test lexing of integer...



details:   https://anonhg.NetBSD.org/src/rev/0bfd94425e7e
branches:  trunk
changeset: 1022253:0bfd94425e7e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 10 18:42:28 2021 +0000

description:
tests/lint: test lexing of integer suffixes

diffstat:

 tests/usr.bin/xlint/lint1/lex_integer.c |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r bb6d5a6103aa -r 0bfd94425e7e tests/usr.bin/xlint/lint1/lex_integer.c
--- a/tests/usr.bin/xlint/lint1/lex_integer.c   Sat Jul 10 18:34:03 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/lex_integer.c   Sat Jul 10 18:42:28 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lex_integer.c,v 1.4 2021/06/29 13:58:13 rillig Exp $   */
+/*     $NetBSD: lex_integer.c,v 1.5 2021/07/10 18:42:28 rillig Exp $   */
 # 3 "lex_integer.c"
 
 /*
@@ -43,3 +43,19 @@
        /* expect+1: conversion of 'unsigned long' to 'unsigned int' is out of range */
        sinku(4294967296U);
 }
+
+void sinkull(unsigned long long);
+
+void
+suffixes(void)
+{
+       sinkull(3u);
+       sinkull(3ll);
+       sinkull(3llu);
+       sinkull(3Ull);
+
+       /* The 'LL' must not be split. Checked by the compiler. */
+       sinkull(3lul);
+       /* The 'Ll' must not used mixed case. Checked by the compiler. */
+       sinkull(3ULl);
+}



Home | Main Index | Thread Index | Old Index