Sync with 5.3.0
[deliverable/titan.core.git] / regression_test / compileonly / selectCase / selectCase.ttcn
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8
9 module selectCase {
10
11 type record of integer RoI;
12
13 type record Rec {
14 RoI numz
15 }
16
17 type record EmptyRec { }
18
19 type record Rec2 {
20 EmptyRec empty
21 }
22
23 function f_embeddedEmptyArray() {
24 var Rec r := { numz := { 1, 2 } };
25
26 select (r) {
27 // this condition used to crash the compiler during code generation (artf521346)
28 case ( { numz := { } } ) {
29 action("empty");
30 }
31 case else {
32 action("not empty");
33 }
34 }
35 }
36
37 function f_emptyArray() {
38 var RoI a := { 1, 2 };
39
40 select (a) {
41 case ( { } ) {
42 action("empty");
43 }
44 case else {
45 action("not empty");
46 }
47 }
48 }
49
50 function f_emptyRecord() {
51 var EmptyRec er := { };
52
53 select (er) {
54 case ( { } ) {
55 action("empty");
56 }
57 case else {
58 action("not empty");
59 }
60 }
61 }
62
63 function f_embeddedEmptyRecord() {
64 var Rec2 r2 := { empty := { } };
65
66 select (r2) {
67 case ( { empty := { } } ) {
68 action("empty");
69 }
70 case else {
71 action("not empty");
72 }
73 }
74 }
75
76 }
This page took 0.035573 seconds and 5 git commands to generate.