Debian Codegraph @

gcc/testsuite/gm2/iso/fail/conststrarray2.mod

raw
1 MODULE conststrarray2 ;
2
3 FROM libc IMPORT printf, exit ;
4
5 CONST
6 HelloWorld = Hello + " " + World ;
7 Hello = "Hello" ;
8 World = "World" ;
9
10
11 (*
12 Assert -
13 *)
14
15 PROCEDURE Assert (result: BOOLEAN) ;
16 BEGIN
17 IF NOT result
18 THEN
19 printf ("assertion failed\n") ;
20 exit (1)
21 END
22 END Assert ;
23
24
25 VAR
26 ch: CHAR ;
27 BEGIN
28 ch := HelloWorld[4] ;
29 Assert (ch = 'o')
30 END conststrarray2.