]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gm2/pim/run/pass/constdynstr.mod
Merge modula-2 front end onto gcc.
[thirdparty/gcc.git] / gcc / testsuite / gm2 / pim / run / pass / constdynstr.mod
1 MODULE constdynstr ;
2
3 FROM DynamicStrings IMPORT String, Length, InitString, KillString ;
4 FROM libc IMPORT printf, exit ;
5
6 VAR
7 r: INTEGER ;
8 s: String ;
9 BEGIN
10 r := 0 ;
11 s := InitString ("\n") ;
12 IF Length (s) # 2
13 THEN
14 printf ("\\n string should be 2 characters long in Modula-2\n") ;
15 r := 1
16 END ;
17 s := KillString (s) ;
18 s := InitString ("\\n") ;
19 IF Length (s) # 3
20 THEN
21 printf ("\\\\n string should be 3 characters long in Modula-2\n") ;
22 r := 2
23 END ;
24 IF r = 0
25 THEN
26 printf ("very basic escaped DynamicStrings pass\n") ;
27 END ;
28 exit (r)
29 END constdynstr.