/ tests / tests / compiler / return / ifelse_chain.adl
ifelse_chain.adl
 1  
 2  // The intent is to test that the amount of code generated
 3  // is only linear in the number of conditions.
 4  program test.alpha {
 5      transition main(a: field) -> u32 {
 6          if a == 0field {
 7              return 0u32;
 8          } else if a == 1field {
 9              return 1u32;
10          } else if a == 2field {
11              return 2u32;
12          } else if a == 3field {
13              return 3u32;
14          } else if a == 4field {
15              return 4u32;
16          }
17  
18          return 5u32;
19      }
20  }