Debian Codegraph @

gcc/testsuite/gm2/errors/fail/badshift.mod

raw
1 (* Copyright (C) 2020 Free Software Foundation, Inc.
2 Contributed by Gaius Mulley <[email protected]>.
3
4 This file is part of GNU Modula-2.
5
6 GNU Modula-2 is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 GNU Modula-2 is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Modula-2; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. *)
19
20 MODULE badshift ;
21
22 (* bad expression containing a legal shift. *)
23
24 FROM SYSTEM IMPORT ADR, ADDRESS, SHIFT ;
25
26 VAR
27 s: SET OF [0..15] ;
28 c: CHAR ;
29 BEGIN
30 (* should generate a subexpression error with the call to SHIFT. *)
31 s := SHIFT (s, 1) + c
32 END badshift.