package TestCase::MyExe {
  use TestCase;
  use TestCase::Minimal;
  use TestCase::Extension;
  sub main : int ($argv : string[]) {
    my $test_num = 0;
    
    # use TestCase::Minimal
    {
      my $minimal = TestCase::Minimal->new;
      $minimal->{x} = 10;

      my $ok = 0;
      if ($minimal->{x} == 10) {
        $ok = 1;
      }
      ok($ok, \$test_num);
    }
    
    # use TestCase
    {
      my $ret = TestCase->my_exe_test(10);
      my $ok = 0;
      if ($ret == 20) {
        $ok = 1;
      }
      ok($ok, \$test_num);
    }
    
    # precompile sub
    {
      my $ret = precompile_sub(3);
      my $ok = 0;
      if ($ret == 9) {
        $ok = 1;
      }
      ok($ok, \$test_num);
    }
    
    # Finish test
    print("1.." . (string)$test_num . "\n");
    
    return 0;
  }
  
  sub ok : void ($ok : int, $test_num_ref : int&) {
    $$test_num_ref = $$test_num_ref + 1;
    if ($ok) {
      print("ok ");
    }
    else {
      print("not ok ");
    }
    print((string)$$test_num_ref . "\n");
  }
  
  precompile sub precompile_sub : int ($num : int) {
    
    return $num * 3;
  }
}
