File: flow.nice

package info (click to toggle)
nice 0.9.12-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,220 kB
  • ctags: 6,894
  • sloc: java: 42,767; xml: 3,508; lisp: 1,079; sh: 736; makefile: 673; cpp: 21; awk: 3
file content (55 lines) | stat: -rw-r--r-- 1,480 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**************************************************************************/
/*                                N I C E                                 */
/*             A high-level object-oriented research language             */
/*                        (c) Daniel Bonniot 2002                         */
/*                                                                        */
/*  This program is free software; you can redistribute it and/or modify  */
/*  it under the terms of the GNU General Public License as published by  */
/*  the Free Software Foundation; either version 2 of the License, or     */
/*  (at your option) any later version.                                   */
/*                                                                        */
/**************************************************************************/

package regtest.basic;

/**
   Test various flow analyses.

   @version $Date: 2002/04/16 11:56:45 $
   @author daniel (bonniot@users.sourceforge.net)
 */

void test_VariableInitialization()
{
  int x = 1;
  int y;
  y = 2;
  int z;
  if (x == 0)
    z = 3;
  else
    z = 4;
  (int a, int b) = (5, 6);
  int c; int d;
  (c, d) = (7, 8);

  int e;
  if (d == d)
    e = 9;
  else
    return;

  int f;
  if (e != e)
    throw new Error();
  else
    f = 10;

  // Checks that all variables are considered initialized by using them.
  println("" + x + y + z + a + b + c + d + e + f);

  int g;
  do {
    g = 0;
  } while (g > 0);
}