aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gm2/iso/run/pass/tstLength.mod
blob: 0445e47f5ec95e53648b67844d6e9b0c142cbd3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
MODULE tstLength;

FROM M2RTS IMPORT Length ;
FROM StrIO IMPORT WriteLn, WriteString ;
FROM NumberIO IMPORT WriteCard ;
FROM libc IMPORT exit ;

VAR
   s: ARRAY [1..5] OF CHAR;
BEGIN
   s := "What?";

   WriteString("LENGTH(s) reports ");
   WriteCard(LENGTH(s), 4); WriteLn;

   WriteString("Length(s) reports ");
   WriteCard(Length(s), 4); WriteLn;
   IF LENGTH(s)#Length(s)
   THEN
      exit(1)
   END
END tstLength.