gcc/testsuite/gm2/pim/pass/testreturnstr.mod
raw| 1 | MODULE testreturnstr ; |
| 2 | |
| 3 | FROM InOut IMPORT WriteString, WriteLn ; |
| 4 | |
| 5 | TYPE |
| 6 | teststr = ARRAY [0..9] OF CHAR; |
| 7 | |
| 8 | PROCEDURE test() : teststr ; |
| 9 | VAR |
| 10 | f: teststr ; |
| 11 | BEGIN |
| 12 | f := "test" ; |
| 13 | RETURN( f ) |
| 14 | END test; |
| 15 | |
| 16 | BEGIN |
| 17 | WriteString('test = "') ; |
| 18 | WriteString(test()) ; |
| 19 | WriteString('"') ; |
| 20 | WriteLn |
| 21 | END testreturnstr. |