Jacks Tests

Jacks Logo Testing Java is easy, if you play your cards right.

jls section directory
3.2 tests/jls/lexical-structure/lexical-translations
3.3 tests/jls/lexical-structure/unicode-escapes
3.4 tests/jls/lexical-structure/line-terminators
3.5 tests/jls/lexical-structure/input-elements-and-tokens
3.6 tests/jls/lexical-structure/white-space
3.7 tests/jls/lexical-structure/comments
3.8 tests/jls/lexical-structure/identifiers
3.9 tests/jls/lexical-structure/keywords
3.10.1 tests/jls/lexical-structure/literals/integer-literals
3.10.2 tests/jls/lexical-structure/literals/floating-point-literals
3.10.4 tests/jls/lexical-structure/literals/character-literals
3.10.5 tests/jls/lexical-structure/literals/string-literals
3.10.7 tests/jls/lexical-structure/literals/escape-sequences
4.5.4 tests/jls/types-values-and-variables/variables/final-variables
5.1.1 tests/jls/conversions-and-promotions/kinds-of-conversion/identity-conversions
5.1.2 tests/jls/conversions-and-promotions/kinds-of-conversion/widening-primitive-conversions
5.1.3 tests/jls/conversions-and-promotions/kinds-of-conversion/narrowing-primitive-conversions
5.2 tests/jls/conversions-and-promotions/assignment-conversion
6.3 tests/jls/names/scope-of-a-declaration
6.4.2 tests/jls/names/members-and-inheritance/members-of-a-class-type
6.4.3 tests/jls/names/members-and-inheritance/members-of-an-interface-type
6.4.4 tests/jls/names/members-and-inheritance/members-of-an-array-type
6.6.1 tests/jls/names/access-control/determining-accessibility
7.3 tests/jls/packages/compilation-units
7.4.1 tests/jls/packages/package-declarations/named-packages
7.4.2 tests/jls/packages/package-declarations/unnamed-packages
7.5.1 tests/jls/packages/import-declarations/single-type-import-declaration
7.5.2 tests/jls/packages/import-declarations/type-import-on-demand-declaration
7.6 tests/jls/packages/top-level-type-declarations
8.1.1 tests/jls/classes/class-declaration/class-modifiers
8.1.1.1 tests/jls/classes/class-declaration/class-modifiers/abstract-classes
8.1.1.2 tests/jls/classes/class-declaration/class-modifiers/final-classes
8.1.3 tests/jls/classes/class-declaration/superclasses-and-subclasses
8.2 tests/jls/classes/class-members
8.4.5 tests/jls/classes/method-declarations/method-body
8.5.1 tests/jls/classes/member-type-declarations/access-modifiers
8.5.2 tests/jls/classes/member-type-declarations/static-member-type-declarations
8.8 tests/jls/classes/constructor-declarations
8.8.1 tests/jls/classes/constructor-declarations/formal-parameters
8.8.2 tests/jls/classes/constructor-declarations/constructor-signature
8.8.3 tests/jls/classes/constructor-declarations/constructor-modifiers
8.8.5 tests/jls/classes/constructor-declarations/constructor-body
8.8.5.1 tests/jls/classes/constructor-declarations/constructor-body/explicit-constructor-invocations
8.8.6 tests/jls/classes/constructor-declarations/constructor-overloading
8.8.7 tests/jls/classes/constructor-declarations/default-constructor
9.1.1 tests/jls/interfaces/interface-declarations/interface-modifiers
9.1.1.1 tests/jls/interfaces/interface-declarations/interface-modifiers/abstract-interfaces
10.6 tests/jls/arrays/array-initializers
14.7 tests/jls/blocks-and-statements/labeled-statements
14.10 tests/jls/blocks-and-statements/switch-statement
14.14 tests/jls/blocks-and-statements/break-statement
14.15 tests/jls/blocks-and-statements/continue-statement
14.20 tests/jls/blocks-and-statements/unreachable-statements
15.9 tests/jls/expressions/class-instance-creation
15.9.1 tests/jls/expressions/class-instance-creation/determining-the-class
15.10 tests/jls/expressions/array-creation-expressions
15.12.2.1 tests/jls/expressions/method-invocation-expressions/determine-method-signature/applicable-and-accessible
15.14.1 tests/jls/expressions/postfix-expressions/postfix-increment-operator
15.14.2 tests/jls/expressions/postfix-expressions/postfix-decrement-operator
15.15 tests/jls/expressions/unary-operators
15.15.1 tests/jls/expressions/unary-operators/prefix-increment-operator
15.15.2 tests/jls/expressions/unary-operators/prefix-decrement-operator
15.15.3 tests/jls/expressions/unary-operators/unary-plus-operator
15.15.4 tests/jls/expressions/unary-operators/unary-minus-operator
15.15.5 tests/jls/expressions/unary-operators/bitwise-complement-operator
15.15.6 tests/jls/expressions/unary-operators/logical-complement-operator
15.17 tests/jls/expressions/multiplicative-operators
15.17.1 tests/jls/expressions/multiplicative-operators/multiplication-operator
15.17.2 tests/jls/expressions/multiplicative-operators/division-operator
15.17.3 tests/jls/expressions/multiplicative-operators/remainder-operator
15.18 tests/jls/expressions/additive-operators
15.18.1 tests/jls/expressions/additive-operators/string-concatenation-operator
15.18.2 tests/jls/expressions/additive-operators/numeric-types
15.26.2 tests/jls/expressions/assignment-operators/compound-assignment-operators
15.28 tests/jls/expressions/constant-expression
16.2.7 tests/jls/definite-assignment/statements/if-statements
16.2.8 tests/jls/definite-assignment/statements/switch-statements
runtime section directory
3.10.5 tests/runtime/jls/lexical-structure/literals/string-literals
8.8.7 tests/runtime/jls/classes/constructor-declarations/default-constructor
12.5 tests/runtime/jls/execution/creation-of-new-class-instances
14 tests/runtime/jls/blocks-and-statements
14.10 tests/runtime/jls/blocks-and-statements/switch-statement
14.19.2 tests/runtime/jls/blocks-and-statements/try-statement/try-catch-finally
15.9 tests/runtime/jls/expressions/class-instance-creation
15.12.3 tests/runtime/jls/expressions/method-invocation-expressions/chosen-method-appropriate
15.14 tests/runtime/jls/expressions/postfix-expressions
15.15 tests/runtime/jls/expressions/unary-operators
15.18.1.1 tests/runtime/jls/expressions/additive-operators/string-conversion
15.26.2 tests/runtime/jls/expressions/assignment-operators/compound-assignment-operators
non-jls section directory
argument-expansion tests/non-jls/argument-expansion
encoding tests/non-jls/encoding
random-crashers tests/non-jls/random-crashers
gcj section directory
gcj tests/gcj
jikes section directory
7.5.2 tests/jikes/jls/packages/import-declarations/type-import-on-demand-declaration
8.4.5 tests/jikes/jls/classes/method-declarations/method-body
8.8.5.1 tests/jikes/jls/classes/constructor-declarations/constructor-body/explicit-constructor-invocations
jikes tests/jikes

Section Index:





jls tests


3.2

Directory : tests/jls/lexical-structure/lexical-translations


Test Case: 3.2-invalid-1
The parser must consume the largest token, even if another interpretation is valid

Expected Result: FAIL

Regression Test:

tcltest::test 3.2-invalid-1 { The parser must consume the largest token,
        even if another interpretation is valid } {
    
    empty_class T32i1 {
        int foo(int a, int b) {
            return a--b;
        }
    }

} {FAIL}
Test Case: 3.2-invalid-2
ensure that unicode escapes are processed before tokenization is done

Expected Result: FAIL

Regression Test:

tcltest::test 3.2-invalid-2 { ensure that unicode escapes are processed
        before tokenization is done } {
    
    empty_class T32i2 {
        int foo(int a, int b) {
            return \u0061\u002d\u002d\u0062;
        }
    }

} {FAIL}
Test Case: 3.2-invalid-3
The parser must consume the largest token, even if another interpretation is valid

Expected Result: FAIL

Regression Test:

tcltest::test 3.2-invalid-3 { The parser must consume the largest token,
        even if another interpretation is valid } {
    
    compile [saveas T32i3.java {classT32i3 {}}]

} {FAIL}
Test Case: 3.2-invalid-4
The parser must consume the largest token, even if another interpretation is valid

Expected Result: FAIL

Regression Test:

tcltest::test 3.2-invalid-4 { The parser must consume the largest token,
        even if another interpretation is valid } {
    
    empty_main T32i4 {
        int i = 1/// comment starts at first /, not second
        1;
    }

} {FAIL}
Test Case: 3.2-invalid-5
Comments, as tokens, separate other tokens

Expected Result: FAIL

Regression Test:

tcltest::test 3.2-invalid-5 { Comments, as tokens, separate other tokens } {
    
    empty_main T32i5 {
        int i = 1/**/0;
    }

} {FAIL}
Test Case: 3.2-invalid-6
Comments, as tokens, separate other tokens

Expected Result: FAIL

Regression Test:

tcltest::test 3.2-invalid-6 { Comments, as tokens, separate other tokens } {
    
    empty_main T32i6 {
        i/**/nt i = 10;
    }

} {FAIL}
Test Case: 3.2-invalid-7
Comments, as tokens, separate other tokens

Expected Result: FAIL

Regression Test:

tcltest::test 3.2-invalid-7 { Comments, as tokens, separate other tokens } {
    
    empty_main T32i7 {
        int i = 0;
        i +/**/= 10;
    }

} {FAIL}
Test Case: 3.2-valid-1
Compiler should recognize difference in tokens

Expected Result: PASS

Regression Test:

tcltest::test 3.2-valid-1 { Compiler should recognize difference in tokens } {
    
    empty_main T32v1 {
        boolean b1=""+1instanceof String;
        boolean b2=""+1Linstanceof String;
        boolean b3=""+1Dinstanceof String;
        boolean b4=""+1Finstanceof String;
        boolean b5=""+0x1instanceof String;
        boolean b6=""+0xAinstanceof String;
        boolean b7=""+'1'instanceof String;
        boolean b8=""+1.instanceof String;
        boolean b9=""+.1instanceof String;
    }

} {PASS}
Test Case: 3.2-valid-2
The parser must consume the largest token, even if another interpretation is valid

Expected Result: PASS

Regression Test:

tcltest::test 3.2-valid-2 { The parser must consume the largest token,
        even if another interpretation is valid } {
    
    empty_main T32v2 {
        int i = 1/* only one comment, last / performs division *//1;
    }

} {PASS}

3.3

Directory : tests/jls/lexical-structure/unicode-escapes


Test Case: 3.3-invalid-1
A unicode sequence must have four hex digits

Expected Result: FAIL

Regression Test:

tcltest::test 3.3-invalid-1 { A unicode sequence must have four hex digits } {
    
    compile [saveas T33i1.java {class T33i1 { char c = '\u20'; }}]

} {FAIL}
Test Case: 3.3-invalid-2
A unicode sequence does not recursively form more unicode sequences

Expected Result: FAIL

Regression Test:

tcltest::test 3.3-invalid-2 { A unicode sequence does not recursively
        form more unicode sequences } {
    
    compile [saveas T33i2.java {
class T33i2 {
    String s = "\u005cu005a"; // this sequence is not 'z'
}
    }]

} {FAIL}
Test Case: 3.3-invalid-3
An even number of \ never form a unicode escape

Expected Result: FAIL

Regression Test:

tcltest::test 3.3-invalid-3 { An even number of \ never form a
        unicode escape } {
    
    compile [saveas T33i3.java {class T33i3 {}/* \\u002a/}]

} {FAIL}
Test Case: 3.3-valid-1
Multiple u's are allowed in unicode escapes

Expected Result: PASS

Regression Test:

tcltest::test 3.3-valid-1 { Multiple u's are allowed in unicode escapes } {
    
    compile [saveas T33v1.java {class T33v1 { char c = '\uuuuuuuuuuabcd'; }}]

} {PASS}
Test Case: 3.3-valid-2
Unicode sequences are case insensitive

Expected Result: PASS

Regression Test:

tcltest::test 3.3-valid-2 { Unicode sequences are case insensitive } {
    
    compile [saveas T33v2.java {
class T33v2 {
    void foo(int i) {
        switch (i) {
            case 0:
            case (('\uABcD' == '\uabCd') ? 1 : 0):
        }
    }
}
    }]

} {PASS}
Test Case: 3.3-valid-3
Check that \u replacement matches single quoted char

Expected Result: PASS

Regression Test:

tcltest::test 3.3-valid-3 { Check that \u replacement matches single quoted char } {
    
    compile [saveas T33v3.java {
class T33v3 {
    void foo(int i) {
        switch (i) {
            case 0:
            case (('\u0061' == 'a') ? 1 : 0):
        }
    }
}
    }]

} {PASS}
Test Case: 3.3-valid-4
Check \u replacements in the ASCII range

Expected Result: PASS

Regression Test:

tcltest::test 3.3-valid-4 { Check \u replacements in the ASCII range } {
    

    set class "
class T33v4 \{
    void foo(int i) \{
        switch (i) \{
            case 0:
"

    set total_cases 0

    # Avoid 10 (\n), 13 (\r), 39 ('), and 92 (\)

    foreach {low high} {0 9
                        11 12
                        14 38
                        40 91
                        93 127} {

        for {set i $low} {$i <= $high} {incr i} {
            incr total_cases
            append class [format "%scase ((%d == '\\u%04x') ? %d : 0): // '%c'\n"  "            "  $i $i $total_cases $i]
        }
    }

    append class "        \}\n    \}\n\}\n"

    compile [saveas T33v4.java $class]

} {PASS}

3.4

Directory : tests/jls/lexical-structure/line-terminators


Test Case: 3.4-1
CR (\r) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-1 { CR (\r) is a LineTerminator } {
    
    set S \r
    compile [saveas T341.java "class T341 {$S // $S}"]

} {PASS}
Test Case: 3.4-2
CR (\r) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-2 { CR (\r) is a LineTerminator } {
    
    set S \r
    compile [saveas T342.java "class T342 { // $S}"]

} {PASS}
Test Case: 3.4-3
LF (\n) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-3 { LF (\n) is a LineTerminator } {
    
    set S \n
    compile [saveas T343.java "class T343 {$S // $S}"]

} {PASS}
Test Case: 3.4-4
LF (\n) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-4 { LF (\n) is a LineTerminator } {
    
    set S \n
    compile [saveas T344.java "class T344 { // $S}"]

} {PASS}
Test Case: 3.4-5
CR + LF (\r\n) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-5 { CR + LF (\r\n) is a LineTerminator } {
    
    set S \r\n
    compile [saveas T345.java "class T345 {$S // $S}"]

} {PASS}
Test Case: 3.4-6
CR + LF (\r\n) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-6 { CR + LF (\r\n) is a LineTerminator } {
    
    set S \r\n
    compile [saveas T346.java "class T346 { // $S}"]

} {PASS}
Test Case: 3.4-7
CR (\u000d) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-7 { CR (\u000d) is a LineTerminator } {
    
    set S \\u000d
    compile [saveas T347.java "class T347 {$S // $S}"]

} {PASS}
Test Case: 3.4-8
CR (\u000d) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-8 { CR (\u000d) is a LineTerminator } {
    
    set S \\u000d
    compile [saveas T348.java "class T348 { // $S}"]

} {PASS}
Test Case: 3.4-9
LF (\u000a) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-9 { LF (\u000a) is a LineTerminator } {
    
    set S \\u000a
    compile [saveas T349.java "class T349 {$S // $S}"]

} {PASS}
Test Case: 3.4-10
LF (\u000a) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-10 { LF (\u000a) is a LineTerminator } {
    
    set S \\u000a
    compile [saveas T3410.java "class T3410 { // $S}"]

} {PASS}
Test Case: 3.4-11
CR + LF (\u000d\u000a) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-11 { CR + LF (\u000d\u000a) is a LineTerminator } {
    
    set S \\u000d\\u000a
    compile [saveas T3411.java "class T3411 {$S // $S}"]

} {PASS}
Test Case: 3.4-12
CR + LF (\u000d\u000a) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-12 { CR + LF (\u000d\u000a) is a LineTerminator } {
    
    set S \\u000d\\u000a
    compile [saveas T3412.java "class T3412 { // $S}"]

} {PASS}
Test Case: 3.4-13
CR + CR (\u000d\u000d) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-13 { CR + CR (\u000d\u000d) is two LineTerminators } {
    
    set S \\u000d\\u000d
    compile [saveas T3413.java "class T3413 {$S // $S}"]

} {PASS}
Test Case: 3.4-14
CR + CR (\u000d\u000d) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-14 { CR + CR (\u000d\u000d) is two LineTerminators } {
    
    set S \\u000d\\u000d
    compile [saveas T3414.java "class T3414 { // $S}"]

} {PASS}
Test Case: 3.4-15
LF + LF (\u000a\u000a) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-15 { LF + LF (\u000a\u000a) is two LineTerminators } {
    
    set S \\u000a\\u000a
    compile [saveas T3415.java "class T3415 {$S // $S}"]

} {PASS}
Test Case: 3.4-16
LF + LF (\u000a\u000a) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-16 { LF + LF (\u000a\u000a) is two LineTerminators } {
    
    set S \\u000a\\u000a
    compile [saveas T3416.java "class T3416 { // $S}"]

} {PASS}
Test Case: 3.4-17
CR + CR (\u000d\r) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-17 { CR + CR (\u000d\r) is two LineTerminators } {
    
    set S \\u000d\r
    compile [saveas T3417.java "${S}class T3417 {}"]

} {PASS}
Test Case: 3.4-18
LF + LF (\u000a\n) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-18 { LF + LF (\u000a\n) is two LineTerminators } {
    
    set S \\u000a\n
    compile [saveas T3418.java "${S}class T3418 {}"]

} {PASS}
Test Case: 3.4-19
CR + LF (\u000d\n) is one LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-19 { CR + LF (\u000d\n) is one LineTerminator } {
    
    set S \\u000d\n
    compile [saveas T3419.java "${S}class T3419 {}"]

} {PASS}
Test Case: 3.4-20
LF + CR (\u000a\r) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-20 { LF + CR (\u000a\r) is two LineTerminators } {
    
    set S \\u000a\r
    compile [saveas T3420.java "${S}class T3420 {}"]

} {PASS}
Test Case: 3.4-21
LF + CR + LF (\u000a\r\u000a) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-21 { LF + CR + LF (\u000a\r\u000a) is two LineTerminators } {
    
    set S \\u000a\r\u000a
    compile [saveas T3421.java "${S}class T3421 {}"]

} {PASS}
Test Case: 3.4-22
CR + LF + LF (\u000d\u000a\n) is two LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-22 { CR + LF + LF (\u000d\u000a\n) is two LineTerminators } {
    
    set S \\u000d\\u000a\n
    compile [saveas T3422.java "${S}class T3422 {}"]

} {PASS}
Test Case: 3.4-23
CR + CR + LF + LF (\u000d\u000d\u000a\n) is three LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-23 { CR + CR + LF + LF (\u000d\u000d\u000a\n) is three LineTerminators } {
    
    set S \\u000d\\u000d\\u000a\n
    compile [saveas T3423.java "${S}class T3423 {}"]

} {PASS}
Test Case: 3.4-24
CR + CR + CR + LF (\u000d\u000d\u000d\n) is three LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-24 { CR + CR + CR + LF (\u000d\u000d\u000d\n) is three LineTerminators } {
    
    set S \\u000d\\u000d\\u000d\n
    compile [saveas T3424.java "${S}class T3424 {}"]

} {PASS}
Test Case: 3.4-25
LF (\uu000a) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-25 { LF (\uu000a) is a LineTerminator } {
    
    set S \\uu000a
    compile [saveas T3425.java "${S}class T3425 {}"]

} {PASS}
Test Case: 3.4-26
LF (\uu000a) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-26 { LF (\uu000a) is a LineTerminator } {
    
    set S \\uu000a
    compile [saveas T3426.java "class T3426 { // ${S}}"]

} {PASS}
Test Case: 3.4-27
CR + LF (\uu000d\n) is a LineTerminator

Expected Result: PASS

Regression Test:

tcltest::test 3.4-27 { CR + LF (\uu000d\n) is a LineTerminator } {
    
    set S \\uu000d\n
    compile [saveas T3427.java "${S}class T3427 {}"]

} {PASS}
Test Case: 3.4-28
CR + CR + LF + LF (\u000d\u000d\uu000a\n) is three LineTerminators

Expected Result: PASS

Regression Test:

tcltest::test 3.4-28 { CR + CR + LF + LF (\u000d\u000d\uu000a\n) is three LineTerminators } {
    
    set S \\u000d\\u000d\\uu000a\n
    compile [saveas T3428.java "${S}class T3428 {}"]

} {PASS}

3.5

Directory : tests/jls/lexical-structure/input-elements-and-tokens


Test Case: 3.5-1
The input sequence CRCR (0x0d0d) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-1 { The input sequence CRCR (0x0d0d) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \r\r
    compile [saveas T351.java "class T351 {$S$S}"]

} {PASS}
Test Case: 3.5-2
The input sequence LFLF (0x0a0a) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-2 { The input sequence LFLF (0x0a0a) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \n\n
    compile [saveas T352.java "class T352 {$S$S}"]

} {PASS}
Test Case: 3.5-3
The input sequence LFCR (0x0a0d) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-3 {  The input sequence LFCR (0x0a0d) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \n\r
    compile [saveas T353.java "class T353 {$S$S}"]

} {PASS}
Test Case: 3.5-4
The input sequence CRLFCRLF (0x0d0a0d0a) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-4 {  The input sequence CRLFCRLF (0x0d0a0d0a) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \r\n\r\n
    compile [saveas T354.java "class T354 {$S$S}"]

} {PASS}
Test Case: 3.5-5
The input sequence CRCRLF (0x0d0d0a) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-5 {  The input sequence CRCRLF (0x0d0d0a) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \r\r\n
    compile [saveas T355.java "class T355 {$S$S}"]

} {PASS}
Test Case: 3.5-6
The input sequence LFCRLF (0x0a0d0a) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-6 {  The input sequence LFCRLF (0x0a0d0a) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \n\r\n
    compile [saveas T356.java "class T356 {$S$S}"]

} {PASS}
Test Case: 3.5-7
The input sequence CRLFCR (0x0d0a0d) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-7 {  The input sequence CRLFCR (0x0d0a0d) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \r\n\r
    compile [saveas T357.java "class T357 {$S$S}"]

} {PASS}
Test Case: 3.5-8
The input sequence CRLFLF (0x0d0a0a) should be treated as two line terminators with an empty collection of input elements between them.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-8 {  The input sequence CRLFLF (0x0d0a0a) should be treated as two
        line terminators with an empty collection of input elements between them.} {
    
    set S \r\n\n
    compile [saveas T358.java "class T358 {$S$S}"]

} {PASS}
Test Case: 3.5-9
The ASCII SUB character (0x1a) should be ignored if it is the last character in the escaped stream.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-9 {  The ASCII SUB character (0x1a) should be ignored if it is
        the last character in the escaped stream. } {
    
    set S \x1a
    compile [saveas T359.java "class T359 {  }$S"]

} {PASS}
Test Case: 3.5-10
The ASCII SUB character (0x1a) should be ignored if it is the last character in the escaped stream.

Expected Result: PASS

Regression Test:

tcltest::test 3.5-10 {  The ASCII SUB character (0x1a) should be ignored if it is
        the last character in the escaped stream. } {
    
    set S \\u001a
    compile [saveas T3510.java "class T3510 {  }$S"]

} {PASS}
Test Case: 3.5-11
The ASCII SUB character (0x1a) should be ignored if it is the last character in the escaped stream.

Expected Result: FAIL

Regression Test:

tcltest::test 3.5-11 {  The ASCII SUB character (0x1a) should be ignored if it is
        the last character in the escaped stream. } {
    
    set S \x1a
    compile [saveas T3511.java "class T3511 { $S }"]

} {FAIL}

3.6

Directory : tests/jls/lexical-structure/white-space


Test Case: 3.6-invalid-1
Vertical tab (Ctrl-K) '\v' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-1 { Vertical tab (Ctrl-K) '\v' is not whitespace } {
    
    whitespace T36i1 \v

} {FAIL}
Test Case: 3.6-invalid-2
Vertical tab (Ctrl-K) '\u000b' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-2 { Vertical tab (Ctrl-K) '\u000b' is not whitespace } {
    
    whitespace T36i2 {\u000b}

} {FAIL}
Test Case: 3.6-invalid-3
Backspace (Ctrl-H) '\b' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-3 { Backspace (Ctrl-H) '\b' is not whitespace } {
    
    whitespace T36i3 \b

} {FAIL}
Test Case: 3.6-invalid-4
Backspace (Ctrl-H) '\u0008' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-4 { Backspace (Ctrl-H) '\u0008' is not whitespace } {
    
    whitespace T36i4 {\u0008}

} {FAIL}
Test Case: 3.6-invalid-5
Alert (Ctrl-G) '\a' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-5 { Alert (Ctrl-G) '\a' is not whitespace } {
    
    whitespace T36i5 \a

} {FAIL}
Test Case: 3.6-invalid-6
Alert (Ctrl-G) '\u0007' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-6 { Alert (Ctrl-G) '\u0007' is not whitespace } {
    
    whitespace T36i6 {\u0007}

} {FAIL}
Test Case: 3.6-invalid-7
Null '\0' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-7 { Null '\0' is not whitespace } {
    
    whitespace T36i7 \0

} {FAIL}
Test Case: 3.6-invalid-8
Null '\u0000' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-8 { Null '\u0000' is not whitespace } {
    
    whitespace T36i8 {\u0000}

} {FAIL}
Test Case: 3.6-invalid-9
Sub (Ctrl-Z) '\u001a' is not whitespace

Expected Result: FAIL

Regression Test:

tcltest::test 3.6-invalid-9 { Sub (Ctrl-Z) '\u001a' is not whitespace } {
    
    whitespace T36i9 {\u001a}

} {FAIL}
Test Case: 3.6-valid-1
Linefeed (Ctrl-J) '\n' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-1 { Linefeed (Ctrl-J) '\n' is whitespace } {
    
    whitespace T36v1 \n

} {PASS}
Test Case: 3.6-valid-2
Linefeed (Ctrl-J) '\u000a' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-2 { Linefeed (Ctrl-J) '\u000a' is whitespace } {
    
    whitespace T36v2 {\u000a}

} {PASS}
Test Case: 3.6-valid-3
Carriage Return (Ctrl-M) '\r' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-3 { Carriage Return (Ctrl-M) '\r' is whitespace } {
    
    whitespace T36v3 \r

} {PASS}
Test Case: 3.6-valid-4
Carriage Return (Ctrl-M) '\u000d' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-4 { Carriage Return (Ctrl-M) '\u000d' is whitespace } {
    
    whitespace T36v4 {\u000d}

} {PASS}
Test Case: 3.6-valid-5
CR/LF '\r\n' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-5 { CR/LF '\r\n' is whitespace } {
    
    whitespace T36v5 \r\n

} {PASS}
Test Case: 3.6-valid-6
CR/LF '\u000d\u000a' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-6 { CR/LF '\u000d\u000a' is whitespace } {
    
    whitespace T36v6 {\u000d\u000a}

} {PASS}
Test Case: 3.6-valid-7
Space ' ' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-7 { Space ' ' is whitespace } {
    
    whitespace T36v7 " "

} {PASS}
Test Case: 3.6-valid-8
Space '\u0020' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-8 { Space '\u0020' is whitespace } {
    
    whitespace T36v8 {\u0020}

} {PASS}
Test Case: 3.6-valid-9
Tab (Ctrl-I) '\t' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-9 { Tab (Ctrl-I) '\t' is whitespace } {
    
    whitespace T36v9 \t

} {PASS}
Test Case: 3.6-valid-10
Tab (Ctrl-I) '\u0009' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-10 { Tab (Ctrl-I) '\u0009' is whitespace } {
    
    whitespace T36v10 {\u0009}

} {PASS}
Test Case: 3.6-valid-11
Form Feed (Ctrl-L) '\f' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-11 { Form Feed (Ctrl-L) '\f' is whitespace } {
    
    whitespace T36v11 \f

} {PASS}
Test Case: 3.6-valid-12
Form Feed (Ctrl-L) '\u000c' is whitespace

Expected Result: PASS

Regression Test:

tcltest::test 3.6-valid-12 { Form Feed (Ctrl-L) '\u000c' is whitespace } {
    
    whitespace T36v12 {\u000c}

} {PASS}

3.7

Directory : tests/jls/lexical-structure/comments


Test Case: 3.7-1
/* anything */ is a comment

Expected Result: PASS

Regression Test:

tcltest::test 3.7-1 { /* anything */ is a comment } {
    
    compile [saveas T371.java "class T371 {/* / * // * / exit */}"]

} {PASS}
Test Case: 3.7-2
/* */ comment can span multiple lines

Expected Result: PASS

Regression Test:

tcltest::test 3.7-2 { /* */ comment can span multiple lines } {
    
    compile [saveas T372.java "class T372 {/* hello\n bye \n*/}"]

} {PASS}
Test Case: 3.7-3
// comment inside /* */ comment is ignored

Expected Result: PASS

Regression Test:

tcltest::test 3.7-3 { // comment inside /* */ comment is ignored } {
    
    compile [saveas T373.java "class T373 {/* hello\n // */}"]

} {PASS}
Test Case: 3.7-4
// comment inside // comment is ignored

Expected Result: PASS

Regression Test:

tcltest::test 3.7-4 { // comment inside // comment is ignored } {
    
    compile [saveas T374.java "class T374 {// //\n}"]

} {PASS}
Test Case: 3.7-5
/* */ comment inside // comment is ignored

Expected Result: PASS

Regression Test:

tcltest::test 3.7-5 { /* */ comment inside // comment is ignored } {
    
    compile [saveas T375.java "class T375 {// /*\n//*/\n}"]

} {PASS}
Test Case: 3.7-6
/* or // inside /* */ comment is ignored

Expected Result: PASS

Regression Test:

tcltest::test 3.7-6 { /* or // inside /* */ comment is ignored } {
    
    compile [saveas T376.java "class T376 {/* comment /* // /* */}"]

} {PASS}
Test Case: 3.7-7
/* or // inside /** */ comment is ignored

Expected Result: PASS

Regression Test:

tcltest::test 3.7-7 { /* or // inside /** */ comment is ignored } {
    
    compile [saveas T377.java "class T377 {/** comment /* // /* */}"]

} {PASS}
Test Case: 3.7-8
/**/ is a documentaiton comment

Expected Result: PASS

Regression Test:

tcltest::test 3.7-8 { /**/ is a documentaiton comment } {
    
    compile [saveas T378.java "class T378 {/**/}"]

} {PASS}
Test Case: 3.7-9
// comment separates tokens

Expected Result: PASS

Regression Test:

tcltest::test 3.7-9 { // comment separates tokens } {
    
    compile [saveas T379.java "class T379 {int//\ni;}"]

} {PASS}
Test Case: 3.7-10
/**/ comment separates tokens

Expected Result: PASS

Regression Test:

tcltest::test 3.7-10 { /**/ comment separates tokens } {
    
    compile [saveas T3710.java "class T3710 {int/**/i;}"]

} {PASS}
Test Case: 3.7-11
// comment cannot appear in literal

Expected Result: FAIL

Regression Test:

tcltest::test 3.7-11 { // comment cannot appear in literal } {
    
    compile [saveas T3711.java "class T3711 {float f = 1.//\n0;}"]

} {FAIL}
Test Case: 3.7-12
/**/ comment cannot appear in literal

Expected Result: FAIL

Regression Test:

tcltest::test 3.7-12 { /**/ comment cannot appear in literal } {
    
    compile [saveas T3712.java "class T3712 {float f = 1./**/0;}"]

} {FAIL}
Test Case: 3.7-13
// comment cannot appear in literal

Expected Result: FAIL

Regression Test:

tcltest::test 3.7-13 { // comment cannot appear in literal } {
    
    compile [saveas T3713.java "class T3713 {char c = 'a//\n';}"]

} {FAIL}
Test Case: 3.7-14
/**/ comment cannot appear in literal

Expected Result: FAIL

Regression Test:

tcltest::test 3.7-14 { /**/ comment cannot appear in literal } {
    
    compile [saveas T3714.java "class T3714 {char c = 'a/**/';}"]

} {FAIL}
Test Case: 3.7-15
/* must have matching */

Expected Result: FAIL

Regression Test:

tcltest::test 3.7-15 { /* must have matching */ } {
    
    compile [saveas T3715.java "class T3715 {} /*"]

} {FAIL}
Test Case: 3.7-16
// must have matching LineTerminator

Expected Result: FAIL

Regression Test:

tcltest::test 3.7-16 { // must have matching LineTerminator } {
    
    compile [saveas T3716.java "class T3716 {} //"]

} {FAIL}
Test Case: 3.7-17
/**/ comment can contain any characters, including \0, unterminated quotes

Expected Result: PASS

Regression Test:

tcltest::test 3.7-17 { /**/ comment can contain any characters, including \0,
        unterminated quotes } {
    
    empty_class T3717 "/*\0'\"*/"

} {PASS}
Test Case: 3.7-18
/**/ comment can contain any characters, including \0, unterminated quotes

Expected Result: PASS

Regression Test:

tcltest::test 3.7-18 { /**/ comment can contain any characters, including \0,
        unterminated quotes } {
    
    empty_class T3718 {/*\u0000\u0027\u0022*/}

} {PASS}
Test Case: 3.7-19
// comment can contain any characters, including \0, unterminated quotes

Expected Result: PASS

Regression Test:

tcltest::test 3.7-19 { // comment can contain any characters, including \0,
        unterminated quotes } {
    
    empty_class T3719 "//\0'\""

} {PASS}
Test Case: 3.7-20
// comment can contain any characters, including \0, unterminated quotes

Expected Result: PASS

Regression Test:

tcltest::test 3.7-20 { // comment can contain any characters, including \0,
        unterminated quotes } {
    
    empty_class T3720 {//\u0000\u0027\u0022}

} {PASS}
Test Case: 3.7-21
/**/ comment can contain any characters, including ASCII SUB

Expected Result: PASS

Regression Test:

tcltest::test 3.7-21 { /**/ comment can contain any characters, including ASCII SUB } {
    
    empty_class T3721 "/*\x1a*/"

} {PASS}
Test Case: 3.7-22
/**/ comment can contain any characters, including ASCII SUB

Expected Result: PASS

Regression Test:

tcltest::test 3.7-22 { /**/ comment can contain any characters, including ASCII SUB } {
    
    empty_class T3722 {/*\u001a*/}

} {PASS}
Test Case: 3.7-23
// comment can contain any characters, including ASCII SUB

Expected Result: PASS

Regression Test:

tcltest::test 3.7-23 { // comment can contain any characters, including ASCII SUB } {
    
    empty_class T3723 "//\x1a"

} {PASS}
Test Case: 3.7-24
// comment can contain any characters, including ASCII SUB

Expected Result: PASS

Regression Test:

tcltest::test 3.7-24 { // comment can contain any characters, including ASCII SUB } {
    
    empty_class T3724 {//\u001a}

} {PASS}
Test Case: 3.7-25
comments may be unicode

Expected Result: PASS

Regression Test:

tcltest::test 3.7-25 { comments may be unicode } {
    
    empty_main T3725 {
        \u002f\u002f This is a comment\u000a int i;
        \u002f\u002a So's this \u002a\u002f
        i = 1;
    }

} {PASS}

3.8

Directory : tests/jls/lexical-structure/identifiers


Test Case: 3.8-invalid-1
A keyword cannot be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-1 { A keyword cannot be an identifier } {
    
    identifier T38i1 int

} {FAIL}
Test Case: 3.8-invalid-2
A keyword cannot be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-2 { A keyword cannot be an identifier } {
    
    identifier T38i2 {\u0069\u006e\u0074}

} {FAIL}
Test Case: 3.8-invalid-3
A boolean literal cannot be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-3 { A boolean literal cannot be an identifier } {
    
    identifier T38i3 true

} {FAIL}
Test Case: 3.8-invalid-4
A boolean literal cannot be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-4 { A boolean literal cannot be an identifier } {
    
    identifier T38i4 {\u0074\u0072\u0075\u0065}

} {FAIL}
Test Case: 3.8-invalid-5
A null literal cannot be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-5 { A null literal cannot be an identifier } {
    
    identifier T38i5 null

} {FAIL}
Test Case: 3.8-invalid-6
A unicode null literal cannot be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-6 { A unicode null literal cannot be an identifier } {
    
    identifier T38i6 {\u006e\u0075\u006c\u006c}

} {FAIL}
Test Case: 3.8-invalid-7
The first character of an identifier must satisfy Character.isJavaIdentifierStart

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-7 { The first character of an identifier
        must satisfy Character.isJavaIdentifierStart } {
    
    identifier T38i7 1

} {FAIL}
Test Case: 3.8-invalid-8
Trailing characters in an identifier must satisfy Character.isJavaIdentifierPart

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-8 { Trailing characters in an identifier must
        satisfy Character.isJavaIdentifierPart } {
    
    identifier T38i8 i\\uffff

} {FAIL}
Test Case: 3.8-invalid-9
Invalid, as \0 is not short for \u0000

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-invalid-9 { Invalid, as \0 is not short for \u0000 } {
    
    identifier T38i9 i\\0

} {FAIL}
Test Case: 3.8-valid-1
example identifier

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-1 { example identifier } {
    
    identifier T38v1 String

} {PASS}
Test Case: 3.8-valid-2
example identifier

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-2 { example identifier } {
    
    identifier T38v2 i3

} {PASS}
Test Case: 3.8-valid-3
example identifier

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-3 { example identifier } {
    
    identifier T38v3 MAX_VALUE

} {PASS}
Test Case: 3.8-valid-4
example identifier

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-4 { example identifier } {
    
    identifier T38v4 isLetterOrDigit

} {PASS}
Test Case: 3.8-valid-5
valid identifier

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-5 { valid identifier } {
    
    identifier T38v5 _

} {PASS}
Test Case: 3.8-valid-6
valid identifier, although discouraged

Expected Result: OK

Regression Test:

tcltest::test 3.8-valid-6 { valid identifier, although discouraged } {
    
    ok_pass_or_warn [identifier T38v6 \$] 

} {OK}
Test Case: 3.8-valid-7
valid identifier, although discouraged

Expected Result: OK

Regression Test:

tcltest::test 3.8-valid-7 { valid identifier, although discouraged } {
    
    ok_pass_or_warn [identifier T38v7 a_\$1] 

} {OK}
Test Case: 3.8-valid-8
valid identifier, as \ufeff satisfies Character.isJavaIdentifierPart

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-8 { valid identifier, as \ufeff satisfies
        Character.isJavaIdentifierPart } {
    
    identifier T38v8 i\\ufeff

} {PASS}
Test Case: 3.8-valid-9
valid identifier, as \u0000 satisfies Character.isJavaIdentifierPart

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-9 { valid identifier, as \u0000 satisfies
        Character.isJavaIdentifierPart } {
    
    identifier T38v9 i\\u0000

} {PASS}
Test Case: 3.8-valid-10
example of unique identifiers

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-10 { example of unique identifiers } {
    
    compile [saveas T38v10.java {
class T38v10 {
    int \u0041; // LATIN CAPITAL A
    int \u0061; // LATIN SMALL A
    int \u0391; // GREEK CAPITAL ALPHA
    int \u0480; // CYRILLIC SMALL A
}
    }]

} {PASS}
Test Case: 3.8-valid-11
example of unique identifiers

Expected Result: PASS

Regression Test:

tcltest::test 3.8-valid-11 { example of unique identifiers } {
    
    compile [saveas T38v11.java {
class T38v11 {
    int \u00c1; // LATIN CAPITAL A ACUTE
    int \u0041\u0301; // LATIN CAPITAL A, followed by NON-SPACING ACUTE
}
    }]

} {PASS}
Test Case: 3.8-ignorable-1
JCL docs refer to 200a, but this is a typo

Expected Result: FAIL

Regression Test:

tcltest::test 3.8-ignorable-1 { JCL docs refer to 200a, but this is a typo } {
    
    compile [saveas T38ignoreable1.java {
class T38ignoreable1 {
    int i\u200a;
}
    }]

} {FAIL}
Test Case: 3.8-ignorable-2
JCL docs refer to 200a, but real value is 202a

Expected Result: PASS

Regression Test:

tcltest::test 3.8-ignorable-2 { JCL docs refer to 200a, but real value is 202a } {
    
    compile [saveas T38ignoreable2.java {
class T38ignoreable2 {
    int i\u202a;
}
    }]

} {PASS}

3.9

Directory : tests/jls/lexical-structure/keywords


Test Case: 3.9-1
abstract is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-1 { abstract is a keyword } {
    
    keyword T391 abstract

} {FAIL}
Test Case: 3.9-2
boolean is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-2 { boolean is a keyword } {
    
    keyword T392 boolean

} {FAIL}
Test Case: 3.9-3
break is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-3 { break is a keyword } {
    
    keyword T393 break

} {FAIL}
Test Case: 3.9-4
byte is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-4 { byte is a keyword } {
    
    keyword T394 byte

} {FAIL}
Test Case: 3.9-5
case is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-5 { case is a keyword } {
    
    keyword T395 case

} {FAIL}
Test Case: 3.9-6
catch is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-6 { catch is a keyword } {
    
    keyword T396 catch

} {FAIL}
Test Case: 3.9-7
char is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-7 { char is a keyword } {
    
    keyword T397 char

} {FAIL}
Test Case: 3.9-8
class is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-8 { class is a keyword } {
    
    keyword T398 class

} {FAIL}
Test Case: 3.9-9
const is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-9 { const is a keyword } {
    
    keyword T399 const

} {FAIL}
Test Case: 3.9-10
continue is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-10 { continue is a keyword } {
    
    keyword T3910 continue

} {FAIL}
Test Case: 3.9-11
default is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-11 { default is a keyword } {
    
    keyword T3911 default

} {FAIL}
Test Case: 3.9-12
do is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-12 { do is a keyword } {
    
    keyword T3912 do

} {FAIL}
Test Case: 3.9-13
double is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-13 { double is a keyword } {
    
    keyword T3913 double

} {FAIL}
Test Case: 3.9-14
else is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-14 { else is a keyword } {
    
    keyword T3914 else

} {FAIL}
Test Case: 3.9-15
extends is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-15 { extends is a keyword } {
    
    keyword T3915 extends

} {FAIL}
Test Case: 3.9-16
final is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-16 { final is a keyword } {
    
    keyword T3916 final

} {FAIL}
Test Case: 3.9-17
finally is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-17 { finally is a keyword } {
    
    keyword T3917 finally

} {FAIL}
Test Case: 3.9-18
float is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-18 { float is a keyword } {
    
    keyword T3918 float

} {FAIL}
Test Case: 3.9-19
for is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-19 { for is a keyword } {
    
    keyword T3919 for

} {FAIL}
Test Case: 3.9-20
goto is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-20 { goto is a keyword } {
    
    keyword T3920 goto

} {FAIL}
Test Case: 3.9-21
if is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-21 { if is a keyword } {
    
    keyword T3921 if

} {FAIL}
Test Case: 3.9-22
implements is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-22 { implements is a keyword } {
    
    keyword T3922 implements

} {FAIL}
Test Case: 3.9-23
import is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-23 { import is a keyword } {
    
    keyword T3923 import

} {FAIL}
Test Case: 3.9-24
instanceof is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-24 { instanceof is a keyword } {
    
    keyword T3924 instanceof

} {FAIL}
Test Case: 3.9-25
int is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-25 { int is a keyword } {
    
    keyword T3925 int

} {FAIL}
Test Case: 3.9-26
interface is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-26 { interface is a keyword } {
    
    keyword T3926 interface

} {FAIL}
Test Case: 3.9-27
long is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-27 { long is a keyword } {
    
    keyword T3927 long

} {FAIL}
Test Case: 3.9-28
native is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-28 { native is a keyword } {
    
    keyword T3928 native

} {FAIL}
Test Case: 3.9-29
new is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-29 { new is a keyword } {
    
    keyword T3929 new

} {FAIL}
Test Case: 3.9-30
package is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-30 { package is a keyword } {
    
    keyword T3930 package

} {FAIL}
Test Case: 3.9-31
private is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-31 { private is a keyword } {
    
    keyword T3931 private

} {FAIL}
Test Case: 3.9-32
protected is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-32 { protected is a keyword } {
    
    keyword T3932 protected

} {FAIL}
Test Case: 3.9-33
public is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-33 { public is a keyword } {
    
    keyword T3933 public

} {FAIL}
Test Case: 3.9-34
return is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-34 { return is a keyword } {
    
    keyword T3934 return

} {FAIL}
Test Case: 3.9-35
short is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-35 { short is a keyword } {
    
    keyword T3935 short

} {FAIL}
Test Case: 3.9-36
static is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-36 { static is a keyword } {
    
    keyword T3936 static

} {FAIL}
Test Case: 3.9-37
strictfp is a keyword, it is new to version 2 of the JLS spec

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-37 { strictfp is a keyword,
        it is new to version 2 of the JLS spec } {
    
    keyword T3937 strictfp

} {FAIL}
Test Case: 3.9-38
super is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-38 { super is a keyword } {
    
    keyword T3938 super

} {FAIL}
Test Case: 3.9-39
switch is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-39 { switch is a keyword } {
    
    keyword T3939 switch

} {FAIL}
Test Case: 3.9-40
synchronized is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-40 { synchronized is a keyword } {
    
    keyword T3940 synchronized

} {FAIL}
Test Case: 3.9-41
this is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-41 { this is a keyword } {
    
    keyword T3941 this

} {FAIL}
Test Case: 3.9-42
throw is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-42 { throw is a keyword } {
    
    keyword T3942 throw

} {FAIL}
Test Case: 3.9-43
throws is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-43 { throws is a keyword } {
    
    keyword T3943 throws

} {FAIL}
Test Case: 3.9-44
transient is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-44 { transient is a keyword } {
    
    keyword T3944 transient

} {FAIL}
Test Case: 3.9-45
try is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-45 { try is a keyword } {
    
    keyword T3945 try

} {FAIL}
Test Case: 3.9-46
void is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-46 { void is a keyword } {
    
    keyword T3946 void

} {FAIL}
Test Case: 3.9-47
volatile is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-47 { volatile is a keyword } {
    
    keyword T3947 volatile

} {FAIL}
Test Case: 3.9-48
while is a keyword

Expected Result: FAIL

Regression Test:

tcltest::test 3.9-48 { while is a keyword } {
    
    keyword T3948 while

} {FAIL}
Test Case: 3.9-valid-1
asm is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-1 { asm is not a keyword } {
    
    keyword T39v1 asm

} {PASS}
Test Case: 3.9-valid-2
auto is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-2 { auto is not a keyword } {
    
    keyword T39v2 auto

} {PASS}
Test Case: 3.9-valid-3
bool is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-3 { bool is not a keyword } {
    
    keyword T39v3 bool

} {PASS}
Test Case: 3.9-valid-4
const_cast is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-4 { const_cast is not a keyword } {
    
    keyword T39v4 const_cast

} {PASS}
Test Case: 3.9-valid-5
delete is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-5 { delete is not a keyword } {
    
    keyword T39v5 delete

} {PASS}
Test Case: 3.9-valid-6
dynamic_cast is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-6 { dynamic_cast is not a keyword } {
    
    keyword T39v6 dynamic_cast

} {PASS}
Test Case: 3.9-valid-7
enum is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-7 { enum is not a keyword } {
    
    keyword T39v7 enum

} {PASS}
Test Case: 3.9-valid-8
explicit is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-8 { explicit is not a keyword } {
    
    keyword T39v8 explicit

} {PASS}
Test Case: 3.9-valid-9
extern is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-9 { extern is not a keyword } {
    
    keyword T39v9 extern

} {PASS}
Test Case: 3.9-valid-10
friend is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-10 { friend is not a keyword } {
    
    keyword T39v10 friend

} {PASS}
Test Case: 3.9-valid-11
inline is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-11 { inline is not a keyword } {
    
    keyword T39v11 inline

} {PASS}
Test Case: 3.9-valid-12
mutable is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-12 { mutable is not a keyword } {
    
    keyword T39v12 mutable

} {PASS}
Test Case: 3.9-valid-13
namespace is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-13 { namespace is not a keyword } {
    
    keyword T39v13 namespace

} {PASS}
Test Case: 3.9-valid-14
operator is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-14 { operator is not a keyword } {
    
    keyword T39v14 operator

} {PASS}
Test Case: 3.9-valid-15
register is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-15 { register is not a keyword } {
    
    keyword T39v15 register

} {PASS}
Test Case: 3.9-valid-16
reinterpret_cast is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-16 { reinterpret_cast is not a keyword } {
    
    keyword T39v16 reinterpret_cast

} {PASS}
Test Case: 3.9-valid-17
signed is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-17 { signed is not a keyword } {
    
    keyword T39v17 signed

} {PASS}
Test Case: 3.9-valid-18
sizeof is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-18 { sizeof is not a keyword } {
    
    keyword T39v18 sizeof

} {PASS}
Test Case: 3.9-valid-19
static_cast is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-19 { static_cast is not a keyword } {
    
    keyword T39v19 static_cast

} {PASS}
Test Case: 3.9-valid-20
struct is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-20 { struct is not a keyword } {
    
    keyword T39v20 struct

} {PASS}
Test Case: 3.9-valid-21
template is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-21 { template is not a keyword } {
    
    keyword T39v21 template

} {PASS}
Test Case: 3.9-valid-22
typedef is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-22 { typedef is not a keyword } {
    
    keyword T39v22 typedef

} {PASS}
Test Case: 3.9-valid-23
typeid is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-23 { typeid is not a keyword } {
    
    keyword T39v23 typeid

} {PASS}
Test Case: 3.9-valid-24
typename is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-24 { typename is not a keyword } {
    
    keyword T39v24 typename

} {PASS}
Test Case: 3.9-valid-25
union is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-25 { union is not a keyword } {
    
    keyword T39v25 union

} {PASS}
Test Case: 3.9-valid-26
unsigned is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-26 { unsigned is not a keyword } {
    
    keyword T39v26 unsigned

} {PASS}
Test Case: 3.9-valid-27
using is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-27 { using is not a keyword } {
    
    keyword T39v27 using

} {PASS}
Test Case: 3.9-valid-28
virtual is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-28 { virtual is not a keyword } {
    
    keyword T39v28 virtual

} {PASS}
Test Case: 3.9-valid-29
wchar_t is not a keyword

Expected Result: PASS

Regression Test:

tcltest::test 3.9-valid-29 { wchar_t is not a keyword } {
    
    keyword T39v29 wchar_t

} {PASS}

3.10.1

Directory : tests/jls/lexical-structure/literals/integer-literals


Test Case: 3.10.1-invalid-1
2147483648 may appear only as the operand of unary -

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-1 { 2147483648 may appear only as the operand of unary - } {
    
    literal T3101i1 2147483648

} {FAIL}
Test Case: 3.10.1-invalid-2
decimal larger than 2147483648 is not an int

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-2 { decimal larger than 2147483648 is not an int } {
    
    literal T3101i2 12345678901

} {FAIL}
Test Case: 3.10.1-invalid-3
octal larger than 037777777777 is not an int

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-3 { octal larger than 037777777777 is not an int } {
    
    literal T3101i3 040000000000

} {FAIL}
Test Case: 3.10.1-invalid-4
hex larger than 0xffffffff is not an int

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-4 { hex larger than 0xffffffff is not an int } {
    
    literal T3101i4 0x123456789

} {FAIL}
Test Case: 3.10.1-invalid-5
9223372036854775808L may appear only as the operand of unary -

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-5 { 9223372036854775808L may appear only as the
        operand of unary - } {
    
    literal T3101i5 9223372036854775808L

} {FAIL}
Test Case: 3.10.1-invalid-6
decimal larger than 9223372036854775808L is not an int

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-6 { decimal larger than 9223372036854775808L is not an int } {
    
    literal T3101i6 12345678901234567890L

} {FAIL}
Test Case: 3.10.1-invalid-7
octal larger than 01777777777777777777777L is not an int

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-7 { octal larger than 01777777777777777777777L is not an int } {
    
    literal T3101i7 02000000000000000000000L

} {FAIL}
Test Case: 3.10.1-invalid-8
hex larger than 0xffffffffffffffffL is not an int

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-8 { hex larger than 0xffffffffffffffffL is not an int } {
    
    literal T3101i8 0x123456789abcdef01L

} {FAIL}
Test Case: 3.10.1-invalid-9
octal cannot contain '9'

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-9 { octal cannot contain '9' } {
    
    literal T3101i9 09

} {FAIL}
Test Case: 3.10.1-invalid-10
2147483648 may appear only as the operand of unary -

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-10 { 2147483648 may appear only as the operand of unary - } {
    
    literal T3101i10 0-2147483648

} {FAIL}
Test Case: 3.10.1-invalid-11
9223372036854775808L may appear only as the operand of unary -

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-11 { 9223372036854775808L may appear only as the
        operand of unary - } {
    
    literal T3101i11 0-9223372036854775808L

} {FAIL}
Test Case: 3.10.1-invalid-12
0x must be followed by digits

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-12 { 0x must be followed by digits } {
    
    literal T3101i12 0x

} {FAIL}
Test Case: 3.10.1-invalid-13
0x must be followed by digits

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.1-invalid-13 { 0x must be followed by digits } {
    
    literal T3101i13 0xL

} {FAIL}
Test Case: 3.10.1-valid-1
example decimal int literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-1 { example decimal int literal } {
    
    literal T3101v1 0

} {PASS}
Test Case: 3.10.1-valid-2
example octal int literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-2 { example octal int literal } {
    
    literal T3101v2 0372

} {PASS}
Test Case: 3.10.1-valid-3
example hex int literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-3 { example hex int literal } {
    
    literal T3101v3 0xDadaCafe

} {PASS}
Test Case: 3.10.1-valid-4
example hex int literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-4 { example hex int literal } {
    
    literal T3101v4 0X00FF00FF

} {PASS}
Test Case: 3.10.1-valid-5
decimal 0, octal 00, and hex 0x0 are equal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-5 { decimal 0, octal 00, and hex 0x0 are equal } {
    
    compile [saveas T3101v5.java {
class T3101v5 {
    void foo(int i) {
	switch (i) {
	    case 0:
	    case ((0 == 00) ? 1 : 0):
	    case ((0 == 0x0) ? 2 : 0):
	    case ((00 == 0x0) ? 3 : 0):
	}
    }
}
    }]

} {PASS}
Test Case: 3.10.1-valid-6
2147483648 is valid when negative

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-6 { 2147483648 is valid when negative } {
    
    literal T3101v6 -2147483648

} {PASS}
Test Case: 3.10.1-valid-7
example long literal, suffix l (ell) == L

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-7 { example long literal, suffix l (ell) == L } {
    
    literal T3101v7 0l

} {PASS}
Test Case: 3.10.1-valid-8
example long literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-8 { example long literal } {
    
    literal T3101v8 0777L

} {PASS}
Test Case: 3.10.1-valid-9
example long literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-9 { example long literal } {
    
    literal T3101v9 0X100000000L

} {PASS}
Test Case: 3.10.1-valid-10
example long literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-10 { example long literal } {
    
    literal T3101v10 2147483648L

} {PASS}
Test Case: 3.10.1-valid-11
example long literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-11 { example long literal } {
    
    literal T3101v11 0xC0B0L

} {PASS}
Test Case: 3.10.1-valid-12
9223372036854775807L is valid when negative

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-12 { 9223372036854775807L is valid when negative } {
    
    literal T3101v12 -9223372036854775807L

} {PASS}
Test Case: 3.10.1-valid-13
An octal that fits in 32 bits is legal int

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-13 { An octal that fits in 32 bits is legal int } {
    
    literal T3101v13 0000000000000000000000000001

} {PASS}
Test Case: 3.10.1-valid-14
A hex literal that fits in 64 bits is a legal long

Expected Result: PASS

Regression Test:

tcltest::test 3.10.1-valid-14 { A hex literal that fits in 64 bits is a legal long } {
    
    literal T3101v14 0x000012345678CAFEBABEL

} {PASS}

3.10.2

Directory : tests/jls/lexical-structure/literals/floating-point-literals


Test Case: 3.10.2-invalid-1
Whole or fractional part must have a digit

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-1 { Whole or fractional part must have a digit } {
    
    literal T3102i1 .e2

} {FAIL}
Test Case: 3.10.2-invalid-2
Whole or fractional part must have a digit

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-2 { Whole or fractional part must have a digit } {
    
    literal T3102i2 .F

} {FAIL}
Test Case: 3.10.2-invalid-3
Invalid Digits

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-3 { Invalid Digits } {
    
    literal T3102i3 E.1e20

} {FAIL}
Test Case: 3.10.2-invalid-4
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-4 { ExponentPart must include a SignedInteger } {
    
    literal T3102i4 1.E

} {FAIL}
Test Case: 3.10.2-invalid-5
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-5 { ExponentPart must include a SignedInteger } {
    
    literal T3102i5 1.e

} {FAIL}
Test Case: 3.10.2-invalid-6
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-6 { ExponentPart must include a SignedInteger } {
    
    literal T3102i6 1.E+

} {FAIL}
Test Case: 3.10.2-invalid-7
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-7 { ExponentPart must include a SignedInteger } {
    
    literal T3102i7 1.E-

} {FAIL}
Test Case: 3.10.2-invalid-8
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-8 { ExponentPart must include a SignedInteger } {
    
    literal T3102i8 .1eF

} {FAIL}
Test Case: 3.10.2-invalid-9
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-9 { ExponentPart must include a SignedInteger } {
    
    literal T3102i9 .1e-D

} {FAIL}
Test Case: 3.10.2-invalid-10
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-10 { ExponentPart must include a SignedInteger } {
    
    literal T3102i10 1e-d

} {FAIL}
Test Case: 3.10.2-invalid-11
ExponentPart must include a SignedInteger

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-invalid-11 { ExponentPart must include a SignedInteger } {
    
    literal T3102i11 .1e+F

} {FAIL}
Test Case: 3.10.2-round-1
It is an error for a floating-point literal to round to an infinity

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-1 { It is an error for a floating-point
        literal to round to an infinity } {
    
    literal T3102r1 1e39f

} {FAIL}
Test Case: 3.10.2-round-2
It is an error for a floating-point literal to round to an infinity

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-2 { It is an error for a floating-point
        literal to round to an infinity } {
    
    literal T3102r2 -1e310

} {FAIL}
Test Case: 3.10.2-round-3
It is an error for a nonzero floating-point to round to zero

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-3 { It is an error for a nonzero
        floating-point to round to zero } {
    
    literal T3102r3 1e-47f

} {FAIL}
Test Case: 3.10.2-round-4
It is an error for a nonzero floating-point to round to zero

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-4 { It is an error for a nonzero
        floating-point to round to zero } {
    
    literal T3102r4 -1e-326

} {FAIL}
Test Case: 3.10.2-round-5
It is an error for a floating-point literal to round to an infinity

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-5 { It is an error for a floating-point
        literal to round to an infinity } {
    
    literal T3102r5 340282356779733661637539395458142568448f

} {FAIL}
Test Case: 3.10.2-round-6
It is an error for a floating-point literal to round to an infinity

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-6 { It is an error for a floating-point
        literal to round to an infinity } {
    
    literal T3102r6 179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792.0

} {FAIL}
Test Case: 3.10.2-round-7
It is an error for a nonzero floating-point to round to zero

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-7 { It is an error for a nonzero
        floating-point to round to zero } {
    
    literal T3102r7 0.000000000000000000000000000000000000000000000700649232162408535461864791644958065640130970938257885878534141944895541342930300743319094181060791015625f

} {FAIL}
Test Case: 3.10.2-round-8
It is an error for a nonzero floating-point to round to zero

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.2-round-8 { It is an error for a nonzero
        floating-point to round to zero } {
    
    literal T3102r8 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024703282292062327208828439643411068618252990130716238221279284125033775363510437593264991818081799618989828234772285886546332835517796989819938739800539093906315035659515570226392290858392449105184435931802849936536152500319370457678249219365623669863658480757001585769269903706311928279558551332927834338409351978015531246597263579574622766465272827220056374006485499977096599470454020828166226237857393450736339007967761930577506740176324673600968951340535537458516661134223766678604162159680461914467291840300530057530849048765391711386591646239524912623653881879636239373280423891018672348497668235089863388587925628302755995657524455507255189313690836254779186948667994968324049705821028513185451396213837722826145437693412532098591327667236328125

} {FAIL}
Test Case: 3.10.2-float-1
example float literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-1 { example float literal } {
    
    literal T3102f1 1e1f

} {PASS}
Test Case: 3.10.2-float-2
example float literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-2 { example float literal } {
    
    literal T3102f2 2.f

} {PASS}
Test Case: 3.10.2-float-3
example float literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-3 { example float literal } {
    
    literal T3102f3 1.e-1

} {PASS}
Test Case: 3.10.2-float-4
example float literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-4 { example float literal } {
    
    literal T3102f4 .3F

} {PASS}
Test Case: 3.10.2-float-5
example float literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-5 { example float literal } {
    
    literal T3102f5 0f

} {PASS}
Test Case: 3.10.2-float-6
example float literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-6 { example float literal } {
    
    literal T3102f6 3.14f

} {PASS}
Test Case: 3.10.2-float-7
example float literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-7 { example float literal } {
    
    literal T3102f7 6.022137e+23f

} {PASS}
Test Case: 3.10.2-float-8
largest finite float, by JLS

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-8 { largest finite float, by JLS } {
    
    literal T3102f8 3.40282347e+38f

} {PASS}
Test Case: 3.10.2-float-9
smallest finite float

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-9 { smallest finite float } {
    
    literal T3102f9 1.40239846e-45f

} {PASS}
Test Case: 3.10.2-float-10
extra 0s don't affect floating point parsing

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-10 { extra 0s don't affect floating point parsing } {
    
    literal T3102f10 000000000000000000000000000000000000000000000000000000000000000000000000.000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000e00000000000000000000000000000000050f

} {PASS}
Test Case: 3.10.2-float-11
unicode 1e0F

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-11 { unicode 1e0F } {
    
    literal T3102f11 {\u0031\u0065\u0030\u0046}

} {PASS}
Test Case: 3.10.2-float-12
largest finite float, by rounding

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-12 { largest finite float, by rounding } {
    
    constant_expression T3102f12 {340282356779733661637539395458142568447.99999f == Float.MAX_VALUE}

} {PASS}
Test Case: 3.10.2-float-13
smallest finite float, by rounding

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-float-13 { smallest finite float, by rounding } {
    
    literal T3102f13 0.00000000000000000000000000000000000000000000070064923216240853546186479164495806564013097093825788587853414194489554134293030074331909418106079101562500001f

} {PASS}
Test Case: 3.10.2-double-1
example double literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-1 { example double literal } {
    
    literal T3102d1 1E1D

} {PASS}
Test Case: 3.10.2-double-2
example double literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-2 { example double literal } {
    
    literal T3102d2 2.

} {PASS}
Test Case: 3.10.2-double-3
example double literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-3 { example double literal } {
    
    literal T3102d3 .3

} {PASS}
Test Case: 3.10.2-double-4
example double literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-4 { example double literal } {
    
    literal T3102d4 0.0

} {PASS}
Test Case: 3.10.2-double-5
example double literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-5 { example double literal } {
    
    literal T3102d5 3.14

} {PASS}
Test Case: 3.10.2-double-6
example double literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-6 { example double literal } {
    
    literal T3102d6 1e-9d

} {PASS}
Test Case: 3.10.2-double-7
example double literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-7 { example double literal } {
    
    literal T3102d7 1e137

} {PASS}
Test Case: 3.10.2-double-8
largest finite double, by JLS

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-8 { largest finite double, by JLS } {
    
    literal T3102d8 1.79769313486231570e+308

} {PASS}
Test Case: 3.10.2-double-9
smallest finite double

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-9 { smallest finite double } {
    
    literal T3102d9 4.94065645841246544e-324

} {PASS}
Test Case: 3.10.2-double-10
the compiler should correctly round denormalized literals

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-10 { the compiler should correctly
        round denormalized literals } {
    
    constant_expression T3102d10 {.0000000000012345678901234567890e+10 ==
	    1.2345678901234568e-2}

} {PASS}
Test Case: 3.10.2-double-11
extra 0s don't affect floating point parsing

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-11 { extra 0s don't affect floating point parsing } {
    
    literal T3102d11 000000000000000000000000000000000000000000000000000000000000000000000000.000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000e00000000000000000000000000000000050

} {PASS}
Test Case: 3.10.2-double-12
unicode escape the . in float 1.0

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-12 { unicode escape the . in float 1.0 } {
    
    literal T3102d12 1\u002e0

} {PASS}
Test Case: 3.10.2-double-13
largest finite double, by rounding

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-13 { largest finite double, by rounding } {
    
    constant_expression T3102d13 {179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497791.999999 == Double.MAX_VALUE}

} {PASS}
Test Case: 3.10.2-double-14
smallest finite double, by rounding

Expected Result: PASS

Regression Test:

tcltest::test 3.10.2-double-14 { smallest finite double, by rounding } {
    
    literal T3102d14 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002470328229206232720882843964341106861825299013071623822127928412503377536351043759326499181808179961898982823477228588654633283551779698981993873980053909390631503565951557022639229085839244910518443593180284993653615250031937045767824921936562366986365848075700158576926990370631192827955855133292783433840935197801553124659726357957462276646527282722005637400648549997709659947045402082816622623785739345073633900796776193057750674017632467360096895134053553745851666113422376667860416215968046191446729184030053005753084904876539171138659164623952491262365388187963623937328042389101867234849766823508986338858792562830275599565752445550725518931369083625477918694866799496832404970582102851318545139621383772282614543769341253209859132766723632812500001

} {PASS}

3.10.4

Directory : tests/jls/lexical-structure/literals/character-literals


Test Case: 3.10.4-invalid-1
A SingleCharacter cannot be '

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-1 { A SingleCharacter cannot be ' } {
    
    literal T3104i1 '

} {FAIL}
Test Case: 3.10.4-invalid-2
A SingleCharacter cannot be '

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-2 { A SingleCharacter cannot be ' } {
    
    literal T3104i2 {\u0027}

} {FAIL}
Test Case: 3.10.4-invalid-3
A SingleCharacter cannot be \

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-3 { A SingleCharacter cannot be \ } {
    
    literal T3104i3 \\

} {FAIL}
Test Case: 3.10.4-invalid-4
A SingleCharacter cannot be \

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-4 { A SingleCharacter cannot be \ } {
    
    literal T3104i4 {\u005c}

} {FAIL}
Test Case: 3.10.4-invalid-5
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-5 { A LineTerminator is not an InputCharacter } {
    
    literal T3104i5 \r

} {FAIL}
Test Case: 3.10.4-invalid-6
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-6 { A LineTerminator is not an InputCharacter } {
    
    literal T3104i6 \n

} {FAIL}
Test Case: 3.10.4-invalid-7
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-7 { A LineTerminator is not an InputCharacter } {
    
    literal T3104i7 \r\n

} {FAIL}
Test Case: 3.10.4-invalid-8
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-8 { A LineTerminator is not an InputCharacter } {
    
    literal T3104i8 {\u000d}

} {FAIL}
Test Case: 3.10.4-invalid-9
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-9 { A LineTerminator is not an InputCharacter } {
    
    literal T3104i9 {\u000a}

} {FAIL}
Test Case: 3.10.4-invalid-10
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-10 { A LineTerminator is not an InputCharacter } {
    
    literal T3104i10 {\u000d\u000a}

} {FAIL}
Test Case: 3.10.4-invalid-11
' must be terminated with '

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-11 { ' must be terminated with ' } {
    
    literal T3104i11 AB

} {FAIL}
Test Case: 3.10.4-invalid-12
empty character literal is not allowed

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-12 { empty character literal is not allowed } {
    
    literal T3104i12 ""

} {FAIL}
Test Case: 3.10.4-invalid-13
\r\n is two character literals

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-13 { \r\n is two character literals } {
    
    literal T3104i13 {\r\n}

} {FAIL}
Test Case: 3.10.4-invalid-14
' must be terminated with '

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.4-invalid-14 { ' must be terminated with ' } {
    
    compile [saveas T3104i14.java "class T3104i14.java {char c = ';}"]

} {FAIL}
Test Case: 3.10.4-valid-1
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-1 { example character literal } {
    
    literal T3104v1 a

} {PASS}
Test Case: 3.10.4-valid-2
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-2 { example character literal } {
    
    literal T3104v2 %

} {PASS}
Test Case: 3.10.4-valid-3
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-3 { example character literal } {
    
    literal T3104v3 {\t}

} {PASS}
Test Case: 3.10.4-valid-4
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-4 { example character literal } {
    
    literal T3104v4 {\\}

} {PASS}
Test Case: 3.10.4-valid-5
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-5 { example character literal } {
    
    literal T3104v5 {\'}

} {PASS}
Test Case: 3.10.4-valid-6
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-6 { example character literal } {
    
    literal T3104v6 {\u03a9}

} {PASS}
Test Case: 3.10.4-valid-7
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-7 { example character literal } {
    
    literal T3104v7 {\uFFFF}

} {PASS}
Test Case: 3.10.4-valid-8
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-8 { example character literal } {
    
    literal T3104v8 {\177}

} {PASS}
Test Case: 3.10.4-valid-9
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-9 { example character literal } {
    
    literal T3104v9 {\r}

} {PASS}
Test Case: 3.10.4-valid-10
example character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-10 { example character literal } {
    
    literal T3104v10 {\n}

} {PASS}
Test Case: 3.10.4-valid-11
valid character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-11 { valid character literal } {
    
    literal T3104v11 {\"}

} {PASS}
Test Case: 3.10.4-valid-12
valid character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-12 { valid character literal } {
    
    literal T3104v12 {"}

} {PASS}
Test Case: 3.10.4-valid-13
valid character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-13 { valid character literal } {
    
    literal T3104v13 {\u001a}

} {PASS}
Test Case: 3.10.4-valid-14
valid character literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.4-valid-14 { valid character literal } {
    
    literal T3104v14 \x1a

} {PASS}

3.10.5

Directory : tests/jls/lexical-structure/literals/string-literals


Test Case: 3.10.5-invalid-1
A StringCharacter cannot be "

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-1 { A StringCharacter cannot be " } {
    
    literal T3105i1 {"}

} {FAIL}
Test Case: 3.10.5-invalid-2
A StringCharacter cannot be "

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-2 { A StringCharacter cannot be " } {
    
    literal T3105i2 {\u0022}

} {FAIL}
Test Case: 3.10.5-invalid-3
A StringCharacter cannot be \

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-3 { A StringCharacter cannot be \ } {
    
    literal T3105i3 \\

} {FAIL}
Test Case: 3.10.5-invalid-4
A StringCharacter cannot be \

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-4 { A StringCharacter cannot be \ } {
    
    literal T3105i4 {\u005c}

} {FAIL}
Test Case: 3.10.5-invalid-5
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-5 { A LineTerminator is not an InputCharacter } {
    
    literal T3105i5 \r

} {FAIL}
Test Case: 3.10.5-invalid-6
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-6 { A LineTerminator is not an InputCharacter } {
    
    literal T3105i6 \n

} {FAIL}
Test Case: 3.10.5-invalid-7
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-7 { A LineTerminator is not an InputCharacter } {
    
    literal T3105i7 \r\n

} {FAIL}
Test Case: 3.10.5-invalid-8
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-8 { A LineTerminator is not an InputCharacter } {
    
    literal T3105i8 {\u000d}

} {FAIL}
Test Case: 3.10.5-invalid-9
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-9 { A LineTerminator is not an InputCharacter } {
    
    literal T3105i9 {\u000a}

} {FAIL}
Test Case: 3.10.5-invalid-10
A LineTerminator is not an InputCharacter

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-10 { A LineTerminator is not an InputCharacter } {
    
    literal T3105i10 {\u000d\u000a}

} {FAIL}
Test Case: 3.10.5-invalid-11
" must be terminated with "

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.5-invalid-11 { " must be terminated with " } {
    
    compile [saveas T3105i11.java {class T3105i11 {String s = ";}}]

} {FAIL}
Test Case: 3.10.5-valid-1
example string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-1 { example string literal } {
    
    literal T3105v1 ""

} {PASS}
Test Case: 3.10.5-valid-2
example string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-2 { example string literal } {
    
    literal T3105v2 {This is a string}

} {PASS}
Test Case: 3.10.5-valid-3
example string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-3 { example string literal } {
    
    literal T3105v3 {This is a " +
                     "two-line string}

} {PASS}
Test Case: 3.10.5-valid-4
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-4 { valid string literal } {
    
    literal T3105v4 {\\}

} {PASS}
Test Case: 3.10.5-valid-5
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-5 { valid string literal } {
    
    literal T3105v5 {\'}

} {PASS}
Test Case: 3.10.5-valid-6
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-6 { valid string literal } {
    
    literal T3105v6 {\u03a9}

} {PASS}
Test Case: 3.10.5-valid-7
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-7 { valid string literal } {
    
    literal T3105v7 {\uFFFF}

} {PASS}
Test Case: 3.10.5-valid-8
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-8 { valid string literal } {
    
    literal T3105v8 {\177}

} {PASS}
Test Case: 3.10.5-valid-9
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-9 { valid string literal } {
    
    literal T3105v9 {\r}

} {PASS}
Test Case: 3.10.5-valid-10
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-10 { valid string literal } {
    
    literal T3105v10 {\n}

} {PASS}
Test Case: 3.10.5-valid-11
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-11 { valid string literal } {
    
    literal T3105v11 {\"}

} {PASS}
Test Case: 3.10.5-valid-12
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-12 { valid string literal } {
    
    literal T3105v12 '

} {PASS}
Test Case: 3.10.5-valid-13
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-13 { valid string literal } {
    
    literal T3105v13 {\u001a}

} {PASS}
Test Case: 3.10.5-valid-14
valid string literal

Expected Result: PASS

Regression Test:

tcltest::test 3.10.5-valid-14 { valid string literal } {
    
    literal T3105v14 \x1a

} {PASS}

3.10.7

Directory : tests/jls/lexical-structure/literals/escape-sequences


Test Case: 3.10.7-invalid-1
\a (Alert, Ctrl-G) is not an escape sequence

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-1 { \a (Alert, Ctrl-G) is not an escape sequence } {
    
    sequence T3107i1 {\a}

} {FAIL}
Test Case: 3.10.7-invalid-2
\v (Vertical tab, Ctrl-K) is not an escape sequence

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-2 { \v (Vertical tab, Ctrl-K) is not an escape sequence } {
    
    sequence T3107i2 {\v}

} {FAIL}
Test Case: 3.10.7-invalid-3
\x (hex sequence) is not an escape sequence

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-3 { \x (hex sequence) is not an escape sequence } {
    
    sequence T3107i3 {\x0}

} {FAIL}
Test Case: 3.10.7-invalid-4
\LineTerminator is not a valid line continuation

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-4 { \LineTerminator is not a valid line continuation } {
    
    sequence T3107i4 a\\\n

} {FAIL}
Test Case: 3.10.7-invalid-5
\u is not an escape sequence, since unicode is already expanded

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-5 { \u is not an escape sequence, since unicode
        is already expanded } {
    
    sequence T3107i5 {\u005cu}

} {FAIL}
Test Case: 3.10.7-invalid-6
octal escape sequences are limited at 0377

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-6 { octal escape sequences are limited at 0377 } {
    
    sequence T3107i6 {\400}

} {FAIL}
Test Case: 3.10.7-invalid-7
escape sequences are case-sensitive

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-7 { escape sequences are case-sensitive } {
    
    sequence T3107i7 {\N}

} {FAIL}
Test Case: 3.10.7-invalid-8
escape sequences only occur within character and string literals

Expected Result: FAIL

Regression Test:

tcltest::test 3.10.7-invalid-8 { escape sequences only occur within character
        and string literals } {
    
    compile [saveas T3107i8.java "class T3107i8 { \\t }"]

} {FAIL}
Test Case: 3.10.7-valid-1
\b (Backspace, Ctrl-H, \u0008) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-1 { \b (Backspace, Ctrl-H, \u0008) is an escape sequence } {
    
    sequence T3107v1 {\b}

} {PASS}
Test Case: 3.10.7-valid-2
\t (Tab, Ctrl-I, \u0009) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-2 { \t (Tab, Ctrl-I, \u0009) is an escape sequence } {
    
    sequence T3107v2 {\t}

} {PASS}
Test Case: 3.10.7-valid-3
\n (Linefeed, Ctrl-J, \u000a) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-3 { \n (Linefeed, Ctrl-J, \u000a) is an escape sequence } {
    
    sequence T3107v3 {\n}

} {PASS}
Test Case: 3.10.7-valid-4
\f (Formfeed, Ctrl-L, \u000c) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-4 { \f (Formfeed, Ctrl-L, \u000c) is an escape sequence } {
    
    sequence T3107v4 {\f}

} {PASS}
Test Case: 3.10.7-valid-5
\r (Carriage Return, Ctrl-M, \u000d) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-5 { \r (Carriage Return, Ctrl-M, \u000d)
        is an escape sequence } {
    
    sequence T3107v5 {\r}

} {PASS}
Test Case: 3.10.7-valid-6
\" (\u0022) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-6 { \" (\u0022) is an escape sequence } {
    
    sequence T3107v6 {\"}

} {PASS}
Test Case: 3.10.7-valid-7
\' (\u0027) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-7 { \' (\u0027) is an escape sequence } {
    
    sequence T3107v7 {\'}

} {PASS}
Test Case: 3.10.7-valid-8
\\ (\u005c) is an escape sequence

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-8 { \\ (\u005c) is an escape sequence } {
    
    sequence T3107v8 {\\}

} {PASS}
Test Case: 3.10.7-valid-9
octal sequences can have one digit

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-9 { octal sequences can have one digit } {
    
    sequence T3107v9 {\5}

} {PASS}
Test Case: 3.10.7-valid-10
octal sequences can have two digits

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-10 { octal sequences can have two digits } {
    
    sequence T3107v10 {\40}

} {PASS}
Test Case: 3.10.7-valid-11
octal sequences can have three digits, if the first is < 4

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-11 { octal sequences can have three digits,
        if the first is < 4 } {
    
    sequence T3107v11 {\012}

} {PASS}
Test Case: 3.10.7-valid-12
escape sequences may be written in unicode

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-12 { escape sequences may be written in unicode } {
    
    sequence T3107v12 {\u005c\u005c}

} {PASS}
Test Case: 3.10.7-valid-13
an octal sequence with the first digit >= 4 has at most two digits

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-13 { an octal sequence with the first
        digit >= 4 has at most two digits } {
    
    compile [saveas T3107v13.java {
class T3107v13 {
    void foo(int i) {
	switch (i) {
	    case 0:
	    case (("\477" == "'7") ? 1 : 0):
	}
    }
}
    }]

} {PASS}
Test Case: 3.10.7-valid-14
escape sequences represent characters with identical value

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-14 { escape sequences represent characters
        with identical value } {
    
    compile [saveas T3107v14.java {
class T3107v14 {
    void foo(int i) {
	switch (i) {
	    case 0:
	    case (('\t' == 9) ? 1 : 0):
	    case (('\t' == '\011') ? 2 : 0):
	}
    }
}
    }]

} {PASS}
Test Case: 3.10.7-valid-15
escape sequences represent the same character in a String

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-15 { escape sequences represent the same
        character in a String } {
    
    compile [saveas T3107v15.java {
class T3107v15 {
    void foo(int i) {
	switch (i) {
	    case 0:
	    case (("\b" == "\u0008") ? 1 : 0):
	    case (("\10" == "\u0008") ? 2 : 0):
	}
    }
}
    }]

} {PASS}
Test Case: 3.10.7-valid-16
escape sequences only occur within character and string literals

Expected Result: PASS

Regression Test:

tcltest::test 3.10.7-valid-16 { escape sequences only occur within
        character and string literals } {
    
    compile [saveas T3107v16.java {
class T3107v16 {
    // Comment not ended here: \n int i =
}
    }]

} {PASS}

4.5.4

Directory : tests/jls/types-values-and-variables/variables/final-variables


Test Case: 4.5.4-1
final variable must be definitly assigned

Expected Result: FAIL

Regression Test:

tcltest::test 4.5.4-1 { final variable must be definitly assigned } {
    
    compile [saveas T4541.java {
class T4541 {
    final int val;
}
    }]

} {FAIL}
Test Case: 4.5.4-2
final variable must be definitly assigned

Expected Result: PASS

Regression Test:

tcltest::test 4.5.4-2 { final variable must be definitly assigned } {
    
    compile [saveas T4542.java {
class T4542 {
    final int val = 0;
}
    }]

} {PASS}
Test Case: 4.5.4-3
final variable must be definitly assigned

Expected Result: PASS

Regression Test:

tcltest::test 4.5.4-3 { final variable must be definitly assigned } {
    
    compile [saveas T4543.java {
class T4543 {
    final int val;

    T4543() { val = 0; }
}
    }]

} {PASS}
Test Case: 4.5.4-4
final variable can only be assigned to once

Expected Result: FAIL

Regression Test:

tcltest::test 4.5.4-4 { final variable can only be assigned to once } {
    
    compile [saveas T4544.java {
class T4544 {
    final int val = 0;

    T4544() { val = 1; }
}
    }]

} {FAIL}
Test Case: 4.5.4-5
final variable must be assigned before it can be used

Expected Result: FAIL

Regression Test:

tcltest::test 4.5.4-5 { final variable must be assigned before it can be used } {
    
    compile [saveas T4545.java {
class T4545 {
    final int val;

    T4545() { int tmp = val; }
}
    }]

} {FAIL}
Test Case: 4.5.4-6
blank final variable must be assigned in every constructor

Expected Result: FAIL

Regression Test:

tcltest::test 4.5.4-6 { blank final variable must be assigned in every constructor } {
    
    compile [saveas T4546.java {
class T4546 {
    final int val;

    T4546() { val = 0; }
    T4546(int foo) { }
}
    }]

} {FAIL}
Test Case: 4.5.4-7
a final variable can reference an Object, the reference can not change but the object being referenced can change

Expected Result: PASS

Regression Test:

tcltest::test 4.5.4-7 { a final variable can reference an Object, the
        reference can not change but the object being referenced can change } {
    
    compile [saveas T4547.java {
class T4547 {
    final StringBuffer sbuf = new StringBuffer();

    void append() {
        sbuf.append("nuggy");
    }
}
    }]

} {PASS}
Test Case: 4.5.4-8
a final variable can reference an array, the elements of the array can be modified

Expected Result: PASS

Regression Test:

tcltest::test 4.5.4-8 { a final variable can reference an array, the
        elements of the array can be modified } {
    
    compile [saveas T4548.java {
class T4548 {
    final Object[] objarr = {new Object(), new Object()};

    void swap() {
        Object tmp = objarr[0];
        objarr[0] = objarr[1];
        objarr[1] = tmp;
    }
}
    }]

} {PASS}

5.1.1

Directory : tests/jls/conversions-and-promotions/kinds-of-conversion/identity-conversions


Test Case: 5.1.1-primitive-1
boolean identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-1 { boolean identity conversion } {
    
    empty_class T511p1 {
        boolean b1 = (boolean) true;
        boolean b2 = (boolean) b1;
        boolean b3 = (boolean) (false != false);
        boolean b4 = (boolean) Boolean.TRUE.booleanValue();
    }

} {PASS}
Test Case: 5.1.1-primitive-2
byte identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-2 { byte identity conversion } {
    
    empty_class T511p2 {
        static final byte b1 = 1;
        byte b2 = (byte) b1;
        byte b3 = (byte) (new Byte(Byte.MAX_VALUE).byteValue());
    }

} {PASS}
Test Case: 5.1.1-primitive-3
short identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-3 { short identity conversion } {
    
    empty_class T511p3 {
        static final short s1 = 1;
        short s2 = (short) s1;
        short s3 = (short) (new Short(Short.MAX_VALUE).shortValue());
    }

} {PASS}
Test Case: 5.1.1-primitive-4
char identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-4 { char identity conversion } {
    
    empty_class T511p4 {
        char c1 = (char) '1';
        char c2 = (char) c1;
        char c3 = (char) (new Character(Character.MAX_VALUE).charValue());
    }

} {PASS}
Test Case: 5.1.1-primitive-5
int identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-5 { int identity conversion } {
    
    empty_class T511p5 {
        int i1 = (int) 1;
        int i2 = (int) i1;
        int i3 = (int) (1 + 2);
        int i4 = (int) (new Integer(Integer.MAX_VALUE).intValue());
    }

} {PASS}
Test Case: 5.1.1-primitive-6
long identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-6 { long identity conversion } {
    
    empty_class T511p6 {
        long l1 = (long) 1L;
        long l2 = (long) l1;
        long l3 = (long) (1L + 2L);
        long l4 = (long) (new Long(Long.MAX_VALUE).longValue());
    }

} {PASS}
Test Case: 5.1.1-primitive-7
float identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-7 { float identity conversion } {
    
    empty_class T511p7 {
        float f1 = (float) 1.0f;
        float f2 = (float) f1;
        float f3 = (float) (1f + 2f);
        float f4 = (float) (new Float(Float.MAX_VALUE).floatValue());
    }

} {PASS}
Test Case: 5.1.1-primitive-8
double identity conversion

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-primitive-8 { double identity conversion } {
    
    empty_class T511p8 {
        double d1 = (double) 1.0;
        double d2 = (double) d1;
        double d3 = (double) (1.0 + 2.0);
        double d4 = (double) (new Double(Double.MAX_VALUE).doubleValue());
    }

} {PASS}
Test Case: 5.1.1-reference-1
reference identity conversion: Object

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-reference-1 { reference identity conversion: Object } {
    
    empty_class T511r1 {
        Object o1 = (Object) new Object();
        Object o2 = (Object) null;
        Object o3 = (Object) o1;
        Object o4 = (Object) o2;
        Object foo() { return new Object(); }
        Object o5 = (Object) foo();
    }

} {PASS}
Test Case: 5.1.1-reference-2
reference identity conversion: String

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-reference-2 { reference identity conversion: String } {
    
    empty_class T511r2 {
        String s1 = (String) "";
        String s2 = (String) null;
        String s3 = (String) s1;
        String s4 = (String) s2;
        String s5 = (String) ("1" + "2");
        String s6 = (String) "1".concat("2");
    }

} {PASS}
Test Case: 5.1.1-reference-3
reference identity conversion: this class

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-reference-3 { reference identity conversion: this class } {
    
    empty_class T511r3 {
        T511r3 t1 = (T511r3) new T511r3();
        T511r3 t2 = (T511r3) null;
        T511r3 t3 = (T511r3) t1;
        T511r3 t4 = (T511r3) t2;
    }

} {PASS}
Test Case: 5.1.1-reference-4
reference identity conversion: primitive array

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-reference-4 { reference identity conversion: primitive array } {
    
    empty_class T511r4 {
        int[] ia1 = {1, 2};
        int[] ia2 = (int[]) null;
        int[] ia3 = (int[]) ia1;
        int[] ia4 = (int[]) ia2;
        int[] foo() { return new int[0]; }
        int[] ia5 = (int[]) foo();
    }

} {PASS}
Test Case: 5.1.1-reference-5
reference identity conversion: Object array

Expected Result: PASS

Regression Test:

tcltest::test 5.1.1-reference-5 { reference identity conversion: Object array } {
    
    empty_class T511r5 {
        Object[] oa1 = {new Object[1]};
        Object[] oa2 = (Object[]) null;
        Object[] oa3 = (Object[]) oa1;
        Object[] oa4 = (Object[]) oa2;
        Object[] foo() { return new Object[0]; }
        Object[] oa5 = (Object[]) foo();
    }

} {PASS}
Test Case: 5.1.1-null-1
there is no such thing as null identity conversion

Expected Result: FAIL

Regression Test:

tcltest::test 5.1.1-null-1 { there is no such thing as null identity conversion } {
    
    empty_class T511n1 {
        Object n = (null) null;
    }

} {FAIL}

5.1.2

Directory : tests/jls/conversions-and-promotions/kinds-of-conversion/widening-primitive-conversions


Test Case: 5.1.2-itf-1
int to float conversion may lose precision

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-1 { int to float conversion may lose precision } {
    
    constant_expression T512itf1 {1.23456792e8f == (float)123456789}

} {PASS}
Test Case: 5.1.2-itf-2
int to float conversion rounds down to nearest if remainder < .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-2 { int to float conversion rounds down to nearest
        if remainder < .5} {
    
    constant_expression T512itf2 {(float)0x7fffff3f == (float)0x7fffff00}

} {PASS}
Test Case: 5.1.2-itf-3
int to float conversion rounds up to nearest if remainder > .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-3 { int to float conversion rounds up to nearest
        if remainder > .5} {
    
    constant_expression T512itf3 {(float)0x70ffffc1 == (float)0x71000000}

} {PASS}
Test Case: 5.1.2-itf-4
int to float conversion rounds to least significant bit 0 if remainder = .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-4 { int to float conversion rounds to least
        significant bit 0 if remainder = .5} {
    
    constant_expression T512itf4 {(float)0x7fffff40 == (float)0x7fffff00}

} {PASS}
Test Case: 5.1.2-itf-5
int to float conversion rounds to least significant bit 0 if remainder = .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-5 { int to float conversion rounds to least
        significant bit 0 if remainder = .5} {
    
    constant_expression T512itf5 {(float)0x70ffffc0 == (float)0x71000000}

} {PASS}
Test Case: 5.1.2-itf-6
int to float boundary case

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-6 { int to float boundary case } {
    
    constant_expression T512itf6 {(float)Integer.MAX_VALUE == 2.14748365E9f}

} {PASS}
Test Case: 5.1.2-itf-7
int to float boundary case

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-7 { int to float boundary case } {
    
    constant_expression T512itf7 {(float)0 == 0f} {1/(float)0 == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 5.1.2-itf-8
int to float boundary case

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itf-8 { int to float boundary case } {
    
    constant_expression T512itf8 {(float)Integer.MIN_VALUE == -2.14748365E9f}

} {PASS}
Test Case: 5.1.2-itd-1
int to double conversion never loses precision

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itd-1 { int to double conversion never loses precision } {
    
    constant_expression T512itd1 {123456789.0 == (double)123456789}

} {PASS}
Test Case: 5.1.2-itd-2
int to double boundary case

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itd-2 { int to double boundary case } {
    
    constant_expression T512itd2 {(double)Integer.MAX_VALUE == 2.147483647E9}

} {PASS}
Test Case: 5.1.2-itd-3
int to double boundary case

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itd-3 { int to double boundary case } {
    
    constant_expression T512itd3 {(double)0 == 0.0} {1/(double)0 == Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 5.1.2-itd-4
int to double boundary case

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-itd-4 { int to double boundary case } {
    
    constant_expression T512itd4 {(double)Integer.MIN_VALUE == -2.147483648e9}

} {PASS}
Test Case: 5.1.2-ltf-1
long to float conversion may lose precision

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltf-1 { long to float conversion may lose precision } {
    
    constant_expression T512ltf1 {1.23456792e8f == (float)123456789L}

} {PASS}
Test Case: 5.1.2-ltf-2
long to float conversion rounds down to nearest if remainder < .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltf-2 { long to float conversion rounds down to nearest
        if remainder < .5} {
    
    constant_expression T512ltf2 {(float)0x7fffff3fL == (float)0x7fffff00L}

} {PASS}
Test Case: 5.1.2-ltf-3
long to float conversion rounds up to nearest if remainder > .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltf-3 { long to float conversion rounds up to nearest if
        remainder > .5} {
    
    constant_expression T512ltf3 {(float)0x7fffffc1L == (float)0x80000000L}

} {PASS}
Test Case: 5.1.2-ltf-4
long to float conversion rounds to least significant bit 0 if remainder = .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltf-4 { long to float conversion rounds to least
        significant bit 0 if remainder = .5} {
    
    constant_expression T512ltf4 {(float)0x7fffff40L == (float)0x7fffff00L}

} {PASS}
Test Case: 5.1.2-ltf-5
long to float conversion rounds to least significant bit 0 if remainder = .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltf-5 { long to float conversion rounds to least
        significant bit 0 if remainder = .5} {
    
    constant_expression T512ltf5 {(float)0x7fffffc0L == (float)0x80000000L}

} {PASS}
Test Case: 5.1.2-ltf-6
long to float conversion rounds down to nearest if remainder < .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltf-6 { long to float conversion rounds down to
        nearest if remainder < .5} {
    
    constant_expression T512ltf6  {(float)0xffffff7ffffffbfL == (float)0xffffff000000000L}

} {PASS}
Test Case: 5.1.2-ltf-7
long to float conversion rounds down to nearest if remainder < .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltf-7 { long to float conversion rounds down to nearest
        if remainder < .5} {
    
    constant_expression T512ltf7  {(float)0xffffff7ffffffffL == (float)0xffffff000000000L}

} {PASS}
Test Case: 5.1.2-ltd-1
long to double conversion may lose precision

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltd-1 { long to double conversion may lose precision } {
    
    constant_expression T512ltd1 {0x123456789abcde0L == (double)0x123456789abcde7L}

} {PASS}
Test Case: 5.1.2-ltd-2
long to double conversion rounds down to nearest if remainder < .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltd-2 { long to double conversion rounds down to nearest
        if remainder < .5} {
    
    constant_expression T512ltd2 {(double)0xffffff7ffffffbfL == 0xffffff7ffffff80L}

} {PASS}
Test Case: 5.1.2-ltd-3
long to double conversion rounds up to nearest if remainder > .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltd-3 { long to double conversion rounds up to nearest
        if remainder > .5} {
    
    constant_expression T512ltd3 {(double)0xffffff7ffffffc1L == 0xffffff800000000L}

} {PASS}
Test Case: 5.1.2-ltd-4
long to double conversion rounds to least significant bit 0 if remainder = .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltd-4 { long to double conversion rounds to least
        significant bit 0 if remainder = .5} {
    
    constant_expression T512ltd4 {(double)0xffffff7ffffff40L == 0xffffff7ffffff00L}

} {PASS}
Test Case: 5.1.2-ltd-5
long to double conversion rounds to least significant bit 0 if remainder = .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ltd-5 { long to double conversion rounds to least
        significant bit 0 if remainder = .5} {
    
    constant_expression T512ltd5 {(double)0xffffff7ffffffc0L == 0xffffff800000000L}

} {PASS}
Test Case: 5.1.2-ftd-1
float to double conversion never loses precision

Expected Result: PASS

Regression Test:

tcltest::test 5.1.2-ftd-1 { float to double conversion never loses precision } {
    
    constant_expression T512ftd1 {(double)1234567.75f == 1234567.75}

} {PASS}

5.1.3

Directory : tests/jls/conversions-and-promotions/kinds-of-conversion/narrowing-primitive-conversions


Test Case: 5.1.3-nan-1
narrowing from float NaN to int produces 0

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-nan-1 { narrowing from float NaN to int produces 0 } {
    
    constant_expression T513nan1 {(int) Float.NaN == 0} {(int) -Float.NaN == 0}

} {PASS}
Test Case: 5.1.3-nan-2
narrowing from double NaN to int produces 0

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-nan-2 { narrowing from double NaN to int produces 0 } {
    
    constant_expression T513nan2 {(int) Double.NaN == 0} {(int) -Double.NaN == 0}

} {PASS}
Test Case: 5.1.3-nan-3
narrowing from float NaN to long produces 0

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-nan-3 { narrowing from float NaN to long produces 0 } {
    
    constant_expression T513nan3 {(long) Float.NaN == 0L} {(long) -Float.NaN == 0L}

} {PASS}
Test Case: 5.1.3-nan-4
narrowing from double NaN to long produces 0

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-nan-4 { narrowing from double NaN to long produces 0 } {
    
    constant_expression T513nan4 {(long) Double.NaN == 0L} {(long) -Double.NaN == 0L}

} {PASS}
Test Case: 5.1.3-nan-5
narrowing from double NaN to float produces NaN

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-nan-5 { narrowing from double NaN to float produces NaN } {
    
    constant_expression T513nan5 {(float) Double.NaN != (float) Double.NaN}

} {PASS}
Test Case: 5.1.3-dtf-1
narrowing from double to float can overflow

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-dtf-1 { narrowing from double to float can overflow } {
    
    constant_expression T513dtf1 {(float) 1e100 == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 5.1.3-dtf-2
narrowing from double to float can underflow

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-dtf-2 { narrowing from double to float can underflow } {
    
    constant_expression T513dtf2 {(float) 1e-100 == 0.0f}

} {PASS}
Test Case: 5.1.3-dtf-3
narrowing from double to float rounds down if remainder < .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-dtf-3 { narrowing from double to float rounds down if
        remainder < .5 } {
    
    constant_expression T513dtf3 {(float)(double)0x8000ff7ffffL == (float)0x8000ff00000L}

} {PASS}
Test Case: 5.1.3-dtf-4
narrowing from double to float rounds up if remainder > .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-dtf-4 { narrowing from double to float rounds up if
        remainder > .5 } {
    
    constant_expression T513dtf4 {(float)(double)0x8000ff80001L == (float)0x80010000000L}

} {PASS}
Test Case: 5.1.3-dtf-5
narrowing from double to float rounds to lsb 0 if remainder == .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-dtf-5 { narrowing from double to float rounds to lsb 0 if
        remainder == .5 } {
    
    constant_expression T513dtf5 {(float)(double)0x8000ff80000L == (float)0x80010000000L}

} {PASS}
Test Case: 5.1.3-dtf-6
narrowing from double to float rounds to lsb 0 if remainder == .5

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-dtf-6 { narrowing from double to float rounds to lsb 0 if
        remainder == .5 } {
    
    constant_expression T513dtf6 {(float)(double)0x8000f080000L == (float)0x8000f000000L}

} {PASS}
Test Case: 5.1.3-dtf-7
narrowing from double to denorm float rounds to nearest

Expected Result: PASS

Regression Test:

tcltest::test 5.1.3-dtf-7 { narrowing from double to denorm float rounds to nearest } {
    
    constant_expression T513dtf7  {(float)5.877475257357598E-39 == 5.877475e-39f}  {(float)5.8774752573576E-39 == 5.877476e-39f}  {(float)5.87747595800683E-39 == 5.877476e-39f}  {(float)5.877476658656061E-39 == 5.877476e-39f}  {(float)5.877476658656063E-39 == 5.877477e-39f}

} {PASS}

5.2

Directory : tests/jls/conversions-and-promotions/assignment-conversion


Test Case: 5.2-narrow-1
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-1 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n1 {
        final int i = 1;
        byte b = i;
    }

} {PASS}
Test Case: 5.2-narrow-2
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-2 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n2 {
        final int i = 1;
        char c = i;
    }

} {PASS}
Test Case: 5.2-narrow-3
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-3 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n3 {
        final int i = 1;
        short s = i;
    }

} {PASS}
Test Case: 5.2-narrow-4
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-4 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n4 {
        final short s = 1;
        byte b = s;
    }

} {PASS}
Test Case: 5.2-narrow-5
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-5 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n5 {
        final short s = 1;
        char c = s;
    }

} {PASS}
Test Case: 5.2-narrow-6
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-6 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n6 {
        final byte b = 1;
        char c = b;
    }

} {PASS}
Test Case: 5.2-narrow-7
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-7 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n7 {
        final char c = 1;
        byte b = c;
    }

} {PASS}
Test Case: 5.2-narrow-8
Assignment conversion may narrow if constant expression is representable in new type

Expected Result: PASS

Regression Test:

tcltest::test 5.2-narrow-8 { Assignment conversion may narrow if constant
        expression is representable in new type } {
    
    empty_main T52n8 {
        final short s = 1;
        char c = s;
    }

} {PASS}

6.3

Directory : tests/jls/names/scope-of-a-declaration


Test Case: 6.3-1
symbol used in field initialization must be defined before it can be used

Expected Result: FAIL

Regression Test:

tcltest::test 6.3-1 { symbol used in field initialization must be defined before it can be used } {
    
    compile [saveas IllegalForwardReference.java  {
public class IllegalForwardReference {
  int a = b;
  int b = 0;
}
}]

} {FAIL}
Test Case: 6.3-2
forward reference to a field outside of an initializer is legal

Expected Result: PASS

Regression Test:

tcltest::test 6.3-2 { forward reference to a field outside of an initializer is legal } {
    
    compile [saveas LegalForwardReference.java  {
public class LegalForwardReference {
  void foo() { a = 1; }
  int a;
}
}]

} {PASS}
Test Case: 6.3-3
use of a class before it is defined is legal

Expected Result: PASS

Regression Test:

tcltest::test 6.3-3 { use of a class before it is defined is legal } {
    
    compile [saveas UseOfTypeBeforeDeclaration.java  {
public class UseOfTypeBeforeDeclaration {
  Object o = new UseOfTypeBeforeDeclaration_Type();
}

class UseOfTypeBeforeDeclaration_Type {
  Object o = new UseOfTypeBeforeDeclaration();
}
}]

} {PASS}
Test Case: 6.3-4
the scope of a class includes every known member of the package, so we should be able to make a forward ref

Expected Result: PASS

Regression Test:

tcltest::test 6.3-4 { the scope of a class includes every known member of
        the package, so we should be able to make a forward ref } {
    
    saveas GlobalOne.java  {
public class GlobalOne {
    void foo() {
	Object o = new GlobalTwo();
    }
}
}

    saveas GlobalTwo.java  {
public class GlobalTwo {
    void foo() {
	Object o = new GlobalOne();
    }
}
}

    compile GlobalOne.java GlobalTwo.java

} {PASS}

6.4.2

Directory : tests/jls/names/members-and-inheritance/members-of-a-class-type


Test Case: 6.4.2-1
interface member reference can not be ambiguous

Expected Result: FAIL

Regression Test:

tcltest::test 6.4.2-1 { interface member reference can not be ambiguous } {
    
    saveas AmbiguousInterfaceMember.java  {
interface One {
  int VAL = 1;
}

interface Two {
  int VAL = 2;
}

class AmbiguousInterfaceMember implements One, Two {
  int i = VAL;
}
}

    compile AmbiguousInterfaceMember.java

} {FAIL}
Test Case: 6.4.2-2
a qualified reference is not ambiguous

Expected Result: PASS

Regression Test:

tcltest::test 6.4.2-2 { a qualified reference is not ambiguous } {
    
    saveas QualifiedInterfaceMember.java  {
interface One {
  int VAL = 1;
}

interface Two {
  int VAL = 2;
}

class QualifiedInterfaceMember implements One, Two {
  int i = One.VAL;
}
}

    compile QualifiedInterfaceMember.java

} {PASS}

6.4.3

Directory : tests/jls/names/members-and-inheritance/members-of-an-interface-type


Test Case: 6.4.3-1
interface member reference can not be ambiguous

Expected Result: FAIL

Regression Test:

tcltest::test 6.4.3-1 { interface member reference can not be ambiguous } {
    
    saveas AmbiguousExtendedInterfaceMember.java  {
interface One {
  int VAL = 1;
}

interface Two {
  int VAL = 2;
}

interface AmbiguousExtendedInterfaceMember extends One, Two {
  int i = VAL;
}
}

    compile AmbiguousExtendedInterfaceMember.java

} {FAIL}
Test Case: 6.4.3-2
a qualified reference is not ambiguous

Expected Result: PASS

Regression Test:

tcltest::test 6.4.3-2 { a qualified reference is not ambiguous } {
    
    saveas QualifiedExtendedInterfaceMember.java  {
interface One {
  int VAL = 1;
}

interface Two {
  int VAL = 2;
}

interface QualifiedExtendedInterfaceMember extends One, Two {
  int i = Two.VAL;
}
}

    compile QualifiedExtendedInterfaceMember.java

} {PASS}

6.4.4

Directory : tests/jls/names/members-and-inheritance/members-of-an-array-type


Test Case: 6.4.4-1
An array object should be able to access methods defined in the java.lang.Object class

Expected Result: PASS

Regression Test:

tcltest::test 6.4.4-1 { An array object should be able to access methods
        defined in the java.lang.Object class } {
    
    compile [saveas ArrayIsObject.java  {
public class ArrayIsObject {
    public static void main(String[] args) {
        int len = args.length;
        System.out.println(len);
        Class c = args.getClass();
        System.out.println(c);
        String s = args.toString();
        System.out.println(s);
    }
}
}]

} {PASS}
Test Case: 6.4.4-2
the length member of an array is an int

Expected Result: PASS

Regression Test:

tcltest::test 6.4.4-2 { the length member of an array is an int } {
    
    compile [saveas ArrayLengthIsInt.java  {
public class ArrayLengthIsInt {
    void foo() {
        int[] foo = new int[3];
        int val = foo.length;
    }
}
}]

} {PASS}
Test Case: 6.4.4-3
compile error on attempt to change array length member

Expected Result: FAIL

Regression Test:

tcltest::test 6.4.4-3 { compile error on attempt to change array length member } {
    
    compile [saveas ArrayLengthIsFinal.java  {
public class ArrayLengthIsFinal {
    void foo() {
        int[] foo = new int[3];
        foo.length = 4;
    }
}
}]

} {FAIL}

6.6.1

Directory : tests/jls/names/access-control/determining-accessibility


Test Case: 6.6.1-1
A class declared public is accessible from outside the package

Expected Result: PASS

Regression Test:

tcltest::test 6.6.1-1 {A class declared public is accessible from outside the package} {
    
    saveas AccessPublicClassInPackage.java  {
public class AccessPublicClassInPackage {
    pkg.PublicClass ref;
}
}

    saveas pkg/PublicClass.java  {
package pkg;

public class PublicClass {}
}

    compile AccessPublicClassInPackage.java pkg/PublicClass.java

} {PASS}
Test Case: 6.6.1-2
A class declared public is accessible from outside the package when the .java source is loaded from the CLASSPATH

Expected Result: PASS

Regression Test:

tcltest::test 6.6.1-2 {A class declared public is accessible from outside the package
        when the .java source is loaded from the CLASSPATH} {
    
    delete pkg/PublicClass.class
    saveas AccessPublicClassInPackage.java  {
public class AccessPublicClassInPackage {
    pkg.PublicClass ref;
}
}

    compile -classpath . AccessPublicClassInPackage.java

} {PASS}
Test Case: 6.6.1-3
An class declared public is accessible from outside the package when the .class file is loaded from the CLASSPATH

Expected Result: PASS PASS

Regression Test:

tcltest::test 6.6.1-3 {An class declared public is accessible from outside the package
        when the .class file is loaded from the CLASSPATH} {
    
    saveas AccessPublicClassInPackage.java  {
public class AccessPublicClassInPackage {
    pkg.PublicClass ref;
}
}

    saveas pkg/PublicClass.java  {
package pkg;

public class PublicClass {}
}

    list  [compile pkg/PublicClass.java]  [compile -classpath . AccessPublicClassInPackage.java]

} {PASS PASS}
Test Case: 6.6.1-4
An interface declared public is accessible from outside the package

Expected Result: PASS

Regression Test:

tcltest::test 6.6.1-4 {An interface declared public is accessible from outside the package} {
    
    saveas AccessPublicInterfaceInPackage.java  {
public class AccessPublicInterfaceInPackage {
    pkg.PublicInterface ref;
}
}

    saveas pkg/PublicInterface.java  {
package pkg;

public interface PublicInterface {}
}

    compile AccessPublicInterfaceInPackage.java pkg/PublicInterface.java

} {PASS}
Test Case: 6.6.1-5
An interface declared public is accessible from outside the package when the .java source is loaded from the CLASSPATH

Expected Result: PASS

Regression Test:

tcltest::test 6.6.1-5 {An interface declared public is accessible from outside the package
        when the .java source is loaded from the CLASSPATH} {
    
    delete pkg/PublicInterface.class
    compile -classpath . AccessPublicInterfaceInPackage.java

} {PASS}
Test Case: 6.6.1-6
An interface declared public is accessible from outside the package when the .class file is loaded from the CLASSPATH

Expected Result: PASS PASS

Regression Test:

tcltest::test 6.6.1-6 {An interface declared public is accessible from outside the package
        when the .class file is loaded from the CLASSPATH} {
    
    delete pkg/PublicInterface.class
    list  [compile pkg/PublicInterface.java]  [compile -classpath . AccessPublicInterfaceInPackage.java]

} {PASS PASS}
Test Case: 6.6.1-7
Access a public class from inside the package

Expected Result: PASS

Regression Test:

tcltest::test 6.6.1-7 {Access a public class from inside the package} {
    
    saveas pkg/AccessPublicClass.java  {
package pkg;

public class AccessPublicClass {
    PublicClass ref;
}
}

    compile pkg/AccessPublicClass.java pkg/PublicClass.java

} {PASS}
Test Case: 6.6.1-8
A class declared with default access is inaccessible from outside the package

Expected Result: FAIL

Regression Test:

tcltest::test 6.6.1-8 {A class declared with default access is inaccessible from outside the package} {
    
    saveas AccessDefaultClassInPackage.java  {
public class AccessDefaultClassInPackage {
    pkg.DefaultClass ref;
}
}

    saveas pkg/DefaultClass.java  {
package pkg;

class DefaultClass {}
}

    compile AccessDefaultClassInPackage.java pkg/DefaultClass.java

} {FAIL}
Test Case: 6.6.1-9
A class declared with default access is inaccessible from outside the package when the .java source is loaded from the CLASSPATH

Expected Result: FAIL

Regression Test:

tcltest::test 6.6.1-9 {A class declared with default access is inaccessible
        from outside the package when the .java source is loaded from the CLASSPATH} {
    
    delete pkg/DefaultClass.class
    compile -classpath . AccessDefaultClassInPackage.java

} {FAIL}
Test Case: 6.6.1-10
A class declared with default access is inaccessible from outside the package when the .class file is loaded from the CLASSPATH

Expected Result: PASS FAIL

Regression Test:

tcltest::test 6.6.1-10 {A class declared with default access is inaccessible
        from outside the package when the .class file is loaded from the CLASSPATH} {
    
    delete pkg/DefaultClass.class
    list  [compile pkg/DefaultClass.java]  [compile -classpath . AccessDefaultClassInPackage.java]

} {PASS FAIL}
Test Case: 6.6.1-11
An interface declared with default access is inaccessible from outside the package

Expected Result: FAIL

Regression Test:

tcltest::test 6.6.1-11 {An interface declared with default access is inaccessible
        from outside the package} {
    
    saveas AccessDefaultInterfaceInPackage.java  {
public class AccessDefaultInterfaceInPackage {
    pkg.DefaultInterface ref;
}
}

    saveas pkg/DefaultInterface.java  {
package pkg;

interface DefaultInterface {}
}

    compile AccessDefaultInterfaceInPackage.java pkg/DefaultInterface.java

} {FAIL}
Test Case: 6.6.1-12
An interface declared with default access is inaccessible from outside the package when the .java source is loaded from the CLASSPATH

Expected Result: FAIL

Regression Test:

tcltest::test 6.6.1-12 {An interface declared with default access is inaccessible from
        outside the package when the .java source is loaded from the CLASSPATH} {
    
    delete pkg/DefaultInterface.class
    compile -classpath . AccessDefaultInterfaceInPackage.java

} {FAIL}
Test Case: 6.6.1-13
An interface declared with default access is inaccessible from outside the package when the .class file is loaded from the CLASSPATH

Expected Result: PASS FAIL

Regression Test:

tcltest::test 6.6.1-13 {An interface declared with default access is inaccessible from
        outside the package when the .class file is loaded from the CLASSPATH} {
    
    delete pkg/DefaultInterface.class
    list  [compile pkg/DefaultInterface.java]  [compile -classpath . AccessDefaultInterfaceInPackage.java]

} {PASS FAIL}
Test Case: 6.6.1-14
Access a default class from inside the package

Expected Result: PASS

Regression Test:

tcltest::test 6.6.1-14 {Access a default class from inside the package} {
    
    saveas pkg/AccessDefaultClass.java  {
package pkg;

public class AccessDefaultClass {
    DefaultClass ref;
}
}

    compile pkg/AccessDefaultClass.java pkg/DefaultClass.java

} {PASS}

7.3

Directory : tests/jls/packages/compilation-units


Test Case: 7.3-1
A compilation unit may be empty

Expected Result: PASS

Regression Test:

tcltest::test 7.3-1 { A compilation unit may be empty } {
    
    compile [saveas T731.java {}]

} {PASS}
Test Case: 7.3-2
A compilation unit may contain only a package statement

Expected Result: PASS

Regression Test:

tcltest::test 7.3-2 { A compilation unit may contain only a package statement } {
    
    compile [saveas test/T732.java {package test;}]

} {PASS}
Test Case: 7.3-3
A compilation unit may contain only import statements

Expected Result: PASS

Regression Test:

tcltest::test 7.3-3 { A compilation unit may contain only import statements } {
    
    compile [saveas T733.java {import java.io.*;}]

} {PASS}
Test Case: 7.3-4
A compilation unit may contain only a type declaration

Expected Result: PASS

Regression Test:

tcltest::test 7.3-4 { A compilation unit may contain only a type declaration } {
    
    compile [saveas T734.java {class T734 {}}]

} {PASS}
Test Case: 7.3-5
Type declarations are optional in compilation units

Expected Result: PASS

Regression Test:

tcltest::test 7.3-5 { Type declarations are optional in compilation units } {
    
    compile [saveas test/T735.java {package test; import java.io.*;}]

} {PASS}
Test Case: 7.3-6
Package declarations are optional in compilation units

Expected Result: PASS

Regression Test:

tcltest::test 7.3-6 { Package declarations are optional in compilation units } {
    
    compile [saveas T736.java {import java.io.*; class T736 {}}]

} {PASS}
Test Case: 7.3-7
Import declarations are optional in compilation units

Expected Result: PASS

Regression Test:

tcltest::test 7.3-7 { Import declarations are optional in compilation units } {
    
    compile [saveas test/T737.java {package test; class T737 {}}]

} {PASS}
Test Case: 7.3-8
Compilation units may contain package, import, and type-declarations

Expected Result: PASS

Regression Test:

tcltest::test 7.3-8 { Compilation units may contain package, import, and
        type-declarations } {
    
    compile [saveas test/T738.java {package test; import java.io.*; class T738 {}}]

} {PASS}
Test Case: 7.3-9
package must come before import

Expected Result: FAIL

Regression Test:

tcltest::test 7.3-9 { package must come before import } {
    
    compile [saveas test/T739.java {import java.io.*; package test;}]

} {FAIL}
Test Case: 7.3-10
package must come before type-declarations

Expected Result: FAIL

Regression Test:

tcltest::test 7.3-10 { package must come before type-declarations } {
    
    compile [saveas test/T7310.java {class T7310 {} package test;}]

} {FAIL}
Test Case: 7.3-11
import must come before type-declarations

Expected Result: FAIL

Regression Test:

tcltest::test 7.3-11 { import must come before type-declarations } {
    
    compile [saveas T7311.java {class T7311 {} import java.io.*;}]

} {FAIL}
Test Case: 7.3-12
import must come before type-declarations, in this case, the extra ;

Expected Result: FAIL

Regression Test:

tcltest::test 7.3-12 { import must come before type-declarations,
        in this case, the extra ; } {
    
    compile [saveas test/T7312.java {package test;; import java.io.*;}]

} {FAIL}
Test Case: 7.3-13
Every compilation unit implicitly imports every public type from java.lang

Expected Result: PASS

Regression Test:

tcltest::test 7.3-13 { Every compilation unit implicitly imports
        every public type from java.lang } {
    
     compile [saveas test/T7313.java {
package test; class T7313 {
    Object o;
    String s;
    Integer i;
}
}]

} {PASS}

7.4.1

Directory : tests/jls/packages/package-declarations/named-packages


Test Case: 7.4.1-1
compiler should not generate error when compiling a class with a package statement that defines a package that can not be located on the CLASSPATH.

Expected Result: PASS

Regression Test:

tcltest::test 7.4.1-1 {compiler should not generate error when
        compiling a class with a package statement that defines a package
        that can not be located on the CLASSPATH.} {
    
    compile [saveas ClassInNewPackage.java  {
package some_package_that_is_not_known_at_compile_time;

public class ClassInNewPackage {}
}]

} {PASS}

7.4.2

Directory : tests/jls/packages/package-declarations/unnamed-packages


Test Case: 7.4.2-1
Create a public class in the default package

Expected Result: PASS

Regression Test:

tcltest::test 7.4.2-1 {Create a public class in the default package} {
    
    saveas ClassInDefaultPackage.java  {
public class ClassInDefaultPackage {}

class ClassInDefaultPackage_Test extends ClassInDefaultPackage {}
}

    compile ClassInDefaultPackage.java

} {PASS}
Test Case: 7.4.2-2
Extend a class in the default package with another class in default package

Expected Result: PASS

Regression Test:

tcltest::test 7.4.2-2 {Extend a class in the default package with
        another class in default package} {
    
    saveas ExtendClassInDefaultPackage.java  {
class ExtendClassInDefaultPackage extends ClassInDefaultPackage {}
}

    compile ClassInDefaultPackage.java ExtendClassInDefaultPackage.java

} {PASS}

7.5.1

Directory : tests/jls/packages/import-declarations/single-type-import-declaration


Test Case: 7.5.1-1
Doing an import of a class that does not exist should fail

Expected Result: FAIL

Regression Test:

tcltest::test 7.5.1-1 {Doing an import of a class that does not exist should fail} {
    
    compile [saveas FailImportDoesNotExist.java  {
package foo;

import a_class_that_does_not_exist;

public class FailImportDoesNotExist extends Object;
}]

} {FAIL}
Test Case: 7.5.1-2
Extend a public class in the default package with a class in another package

Expected Result: PASS

Regression Test:

tcltest::test 7.5.1-2 {Extend a public class in the
    default package with a class in another package} {
    
    saveas ClassInDefaultPackage.java  {
public class ClassInDefaultPackage {}

class ClassInDefaultPackage_Test extends ClassInDefaultPackage {}
}

    saveas ClassInDefaultPackage_ImportFromGlobal.java  {
package foo;

import ClassInDefaultPackage;

public class ClassInDefaultPackage_ImportFromGlobal
    extends ClassInDefaultPackage {}
}

    compile ClassInDefaultPackage.java ClassInDefaultPackage_ImportFromGlobal.java

} {PASS}
Test Case: 7.5.1-3
Importing a non public class from the global package should fail

Expected Result: FAIL

Regression Test:

tcltest::test 7.5.1-3 {Importing a non public class from the global package should fail} {
    
    saveas ClassInDefaultPackage_FailImportFromGlobal.java  {
package foo;

import ClassInDefaultPackage_Test;

public class ClassInDefaultPackage_FailImportFromGlobal
    extends ClassInDefaultPackage_Test {}
}

    compile ClassInDefaultPackage.java ClassInDefaultPackage_FailImportFromGlobal.java

} {FAIL}

7.5.2

Directory : tests/jls/packages/import-declarations/type-import-on-demand-declaration


Test Case: 7.5.2-1
import *; is not a valid import statement

Expected Result: FAIL

Regression Test:

tcltest::test 7.5.2-1 {import *; is not a valid import statement} {
    
    compile [saveas ImportAllFromGlobal.java  {
package foo;

import *;

public class ImportAllFromGlobal {}
}]

} {FAIL}

7.6

Directory : tests/jls/packages/top-level-type-declarations


Test Case: 7.6-syntax-1
; is a valid top-level TypeDeclaration

Expected Result: PASS

Regression Test:

tcltest::test 7.6-syntax-1 { ; is a valid top-level TypeDeclaration } {
    
    compile [saveas T76syntax1.java {;}]

} {PASS}
Test Case: 7.6-syntax-2
top-level TypeDeclaration

Expected Result: PASS

Regression Test:

tcltest::test 7.6-syntax-2 { top-level TypeDeclaration } {
    
    compile [saveas T76syntax2.java {
class T76syntax2 {}
}]

} {PASS}
Test Case: 7.6-syntax-3
top-level TypeDeclaration

Expected Result: PASS

Regression Test:

tcltest::test 7.6-syntax-3 { top-level TypeDeclaration } {
    
    compile [saveas T76syntax3.java {
interface T76syntax3 {}
}]

} {PASS}
Test Case: 7.6-scope-1
TypeDeclaration within a package must have a unique Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 7.6-scope-1 { TypeDeclaration within a package must
        have a unique Identifier } {
    
    compile [saveas T76scope1.java {
class Point {}
interface Point {}
}]

} {FAIL}
Test Case: 7.6-scope-2
TypeDeclaration cannot conflict with single-type-imports

Expected Result: FAIL

Regression Test:

tcltest::test 7.6-scope-2 { TypeDeclaration cannot conflict with
        single-type-imports } {
    
    compile [saveas T76scope2.java {
import java.util.Vector;
class Vector {}
    }]

} {FAIL}
Test Case: 7.6-scope-3
TypeDeclaration may shadow types in general imports

Expected Result: PASS

Regression Test:

tcltest::test 7.6-scope-3 {  TypeDeclaration may shadow types
        in general imports } {
    
    compile [saveas T76scope3.java {
import java.util.*;
class Vector {}
    }]

} {PASS}
Test Case: 7.6-scope-4
TypeDeclaration may have forward references within a compilation unit

Expected Result: PASS

Regression Test:

tcltest::test 7.6-scope-4 { TypeDeclaration may have forward
        references within a compilation unit } {
    
    compile [saveas T76scope4.java {
class first {
    second a;
}
class second {
    first b;
}
    }]

} {PASS}
Test Case: 7.6-name-1
Test fully qualified toplevel type name

Expected Result: PASS

Regression Test:

tcltest::test 7.6-name-1 { Test fully qualified toplevel type name } {
    
    compile [saveas one/pclass.java {
package one;
public class pclass {}
    }] [saveas numbertest.java {
class pclasstest extends one.pclass {}
}]

} {PASS}
Test Case: 7.6-name-2
Test fully qualified toplevel type name

Expected Result: PASS

Regression Test:

tcltest::test 7.6-name-2 { Test fully qualified toplevel type name } {
    
    compile [saveas one/pinterface.java {
package one;
public interface pinterface {}
    }] [saveas pinterfacetest.java {
interface pinterfacetest extends one.pinterface {}
}]

} {PASS}
Test Case: 7.6-name-3
TypeDeclaration need not be related to the file name if class is not public

Expected Result: PASS

Regression Test:

tcltest::test 7.6-name-3 { TypeDeclaration need not be related
        to the file name if class is not public } {
    
    compile [saveas 76name3.java {
class Unrelated {}
}]

} {PASS}
Test Case: 7.6-optional-restrictions-1
Multiple classes may reside within a compilation unit, if secondary classes are not public and not referenced in other files

Expected Result: PASS

Regression Test:

tcltest::test 7.6-optional-restrictions-1 { Multiple classes may reside
        within a compilation unit, if secondary classes are not public and
        not referenced in other files } {
    
    saveas one.java {
class one {
    three three;
}
class three extends two {}
}

    saveas two.java {
class two extends one {}
}

    compile two.java

} {PASS}
Test Case: 7.6-modifiers-1
Top-level types may not be static

Expected Result: FAIL

Regression Test:

tcltest::test 7.6-modifiers-1 { Top-level types may not be static } {
    
    compile [saveas T76modifiers1.java {static class T76modifiers1.java {}}]

} {FAIL}
Test Case: 7.6-modifiers-2
Top-level types may not be protected

Expected Result: FAIL

Regression Test:

tcltest::test 7.6-modifiers-2 { Top-level types may not be protected } {
    
    compile [saveas T76modifiers2.java {protected class T76modifiers2 {}}]

} {FAIL}
Test Case: 7.6-modifiers-3
Top-level types may not be private

Expected Result: FAIL

Regression Test:

tcltest::test 7.6-modifiers-3 { Top-level types may not be private } {
    
    compile [saveas T76modifiers3.java {private class T76modifiers3 {}}]

} {FAIL}

8.1.1

Directory : tests/jls/classes/class-declaration/class-modifiers


Test Case: 8.1.1-valid-modifier-1
public is valid ClassModifier

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1-valid-modifier-1 { public is valid ClassModifier } {
    
    compile [saveas T811vm1.java {
public class T811vm1 {}
    }]

} {PASS}
Test Case: 8.1.1-valid-modifier-2
abstract is valid ClassModifier

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1-valid-modifier-2 { abstract is valid ClassModifier } {
    
    compile [saveas T811vm2.java {
abstract class T811vm2 {}
    }]

} {PASS}
Test Case: 8.1.1-valid-modifier-3
final is valid ClassModifier

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1-valid-modifier-3 { final is valid ClassModifier } {
    
    compile [saveas T811vm3.java {
final class T811vm3 {}
    }]

} {PASS}
Test Case: 8.1.1-valid-modifier-4
strictfp is valid ClassModifier

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1-valid-modifier-4 { strictfp is valid ClassModifier } {
    
    compile [saveas T811vm4.java {
strictfp class T811vm4 {}
    }]

} {PASS}
Test Case: 8.1.1-duplicate-modifier-1
compile time error to specify a class modifier twice

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1-duplicate-modifier-1 { compile time
        error to specify a class modifier twice } {
    
    compile [saveas T811dm1.java {
public public class T811dm1 {}
    }]

} {FAIL}
Test Case: 8.1.1-duplicate-modifier-2
compile time error to specify a class modifier twice

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1-duplicate-modifier-2 { compile time
        error to specify a class modifier twice } {
    
    compile [saveas T811dm2.java {
abstract abstract class T811dm2 {}
    }]

} {FAIL}
Test Case: 8.1.1-duplicate-modifier-3
compile time error to specify a class modifier twice

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1-duplicate-modifier-3 { compile time
        error to specify a class modifier twice } {
    
    compile [saveas T811dm3.java {
final final class T811dm3 {}
    }]

} {FAIL}
Test Case: 8.1.1-duplicate-modifier-4
compile time error to specify a class modifier twice

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1-duplicate-modifier-4 { compile time
        error to specify a class modifier twice } {
    
    compile [saveas T811dm4.java {
strictfp strictfp class T811dm4 {}
    }]

} {FAIL}

8.1.1.1

Directory : tests/jls/classes/class-declaration/class-modifiers/abstract-classes


Test Case: 8.1.1.1-1
declare an abstract class

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1.1-1 { declare an abstract class } {
    
    compile [saveas AbstractClass.java "public abstract class AbstractClass {}"]

} {PASS}
Test Case: 8.1.1.1-2
Compile time error on attempt to create an instance of an abstract class

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.1-2 { Compile time error on attempt to
        create an instance of an abstract class } {
    
    saveas AbstractClass_CreateInstanceError.java  {
public class AbstractClass_CreateInstanceError {
    Object o = new AbstractClass();
}
}

    compile AbstractClass.java AbstractClass_CreateInstanceError.java

} {FAIL}
Test Case: 8.1.1.1-3
declare an abstract class with an abstract method

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1.1-3 { declare an abstract class with an abstract method } {
    
    compile [saveas AbstractMethodAbstractClass.java  {
public abstract class AbstractMethodAbstractClass {
    abstract void foo();
}
}]

} {PASS}
Test Case: 8.1.1.1-4
a non-abstract class can not have an abstract method

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.1-4 { a non-abstract class can not have an abstract method } {
    
    compile [saveas AbstractMethodNonAbstractClass.java  {
public class AbstractMethodNonAbstractClass {
    abstract void foo();
}
}]

} {FAIL}
Test Case: 8.1.1.1-5
An attempt to inherit from an abstract superclass containing an abstract method without implementing the abstract method or declaring the subclass abstract should generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.1-5 { An attempt to inherit from an abstract superclass containing
        an abstract method without implementing the abstract method or declaring
        the subclass abstract should generate a compile time error } {
    
    saveas InheritAbstractClassError.java  {
abstract class InheritAbstractClassError_Superclass {
    abstract void foo();
}

public class InheritAbstractClassError extends InheritAbstractClassError_Superclass {}
}

    compile InheritAbstractClassError.java

} {FAIL}
Test Case: 8.1.1.1-6
An attempt to inherit from an abstract superclass that extends another class that has an abstract method without implementing the abstract method or declaring the subclass abstract should generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.1-6 { An attempt to inherit from an abstract superclass that
        extends another class that has an abstract method without implementing the abstract
        method or declaring the subclass abstract should generate a compile time error } {
    
    saveas DoubleInheritAbstractClassError.java  {
abstract class DoubleInheritAbstractClassError_Superclass1 {
    abstract void foo();
}

abstract class DoubleInheritAbstractClassError_Superclass2 extends
    DoubleInheritAbstractClassError_Superclass1 {}

public class DoubleInheritAbstractClassError extends DoubleInheritAbstractClassError_Superclass2 {}
}

    compile DoubleInheritAbstractClassError.java

} {FAIL}
Test Case: 8.1.1.1-7
inherit from an abstract class with an abstract method, the subclass must be marked as abstract

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1.1-7 { inherit from an abstract class with an
        abstract method, the subclass must be marked as abstract } {
    
    saveas InheritAbstractClass.java  {
abstract class InheritAbstractClass_Superclass {
    abstract void foo();
}

public abstract class InheritAbstractClass extends InheritAbstractClass_Superclass {}
}

    compile InheritAbstractClass.java

} {PASS}
Test Case: 8.1.1.1-8
Compile time error on attempt to create an instance of an abstract class that inherits from and abstract class

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.1-8 { Compile time error on attempt to create an instance
        of an abstract class that inherits from and abstract class } {
    
    saveas InheritAbstractClass_CreateInstanceError.java  {
public class InheritAbstractClass_CreateInstanceError {
    Object o = new InheritAbstractClass();
}
}

    compile InheritAbstractClass.java InheritAbstractClass_CreateInstanceError.java

} {FAIL}
Test Case: 8.1.1.1-9
It should be possible to inherit from an abstract class that defines no abstract methods, the subclass does not need to be abstract

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1.1-9 { It should be possible to inherit from an abstract class
        that defines no abstract methods, the subclass does not need to be abstract } {
    
    compile [saveas InheritEmptyAbstractClass.java  {
abstract class InheritEmptyAbstractClass_Superclass {}

public class InheritEmptyAbstractClass extends InheritEmptyAbstractClass_Superclass {}
}]

} {PASS}
Test Case: 8.1.1.1-10
Inherit from an abstract class with no methods that also inherits from an abstract class with no methods, subclass does not need to be abstract

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1.1-10 { Inherit from an abstract class with no methods that also
        inherits from an abstract class with no methods, subclass does not need to be abstract } {
    
    saveas DoubleInheritEmptyAbstractClass.java  {
abstract class DoubleInheritEmptyAbstractClass_Superclass1 {}
abstract class DoubleInheritEmptyAbstractClass_Superclass2 extends
    DoubleInheritEmptyAbstractClass_Superclass1 {}

public class DoubleInheritEmptyAbstractClass extends DoubleInheritEmptyAbstractClass_Superclass2 {}
}

    compile DoubleInheritEmptyAbstractClass.java

} {PASS}
Test Case: 8.1.1.1-11
Implement an abstract method inherited from an abstract superclass

Expected Result: PASS

Regression Test:

tcltest::test 8.1.1.1-11 { Implement an abstract method inherited from an abstract superclass } {
    
  saveas ImplementInheritedAbstractMethod.java  {
abstract class ImplementInheritedAbstractMethod_Superclass1 {
    abstract void foo();
}

abstract class ImplementInheritedAbstractMethod_Superclass2 extends
    ImplementInheritedAbstractMethod_Superclass1 {}

public class ImplementInheritedAbstractMethod
    extends ImplementInheritedAbstractMethod_Superclass2 {
    void foo() {}
}
}

  compile ImplementInheritedAbstractMethod.java

} {PASS}
Test Case: 8.1.1.1-12
A compile time error should be generated in the case that an abstract class has two methods with the same signature but different return types, this would create an abstract class that could not be sub-classed

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.1-12 { A compile time error should be generated in the case that
        an abstract class has two methods with the same signature but different return
        types, this would create an abstract class that could not be sub-classed } {
    
    saveas InterfaceSignatureConflict.java  {
interface InterfaceSignatureConflict_Inter {
    void foo();
}

public abstract class InterfaceSignatureConflict implements InterfaceSignatureConflict_Inter {
    public abstract int foo();
}
}

    compile InterfaceSignatureConflict.java

} {FAIL}

8.1.1.2

Directory : tests/jls/classes/class-declaration/class-modifiers/final-classes


Test Case: 8.1.1.2-conflicting-modifier-1
a final class cannot also be declared abstract

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.2-conflicting-modifier-1 { a final class
        cannot also be declared abstract } {
    
    compile [saveas T8112cm1.java {
final abstract class T8112cm1 {}
    }]

} {FAIL}
Test Case: 8.1.1.2-invalid-subclass-1
A compile-time error occurs if the name of a final class appears in the extends clause of another class declaration

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.2-invalid-subclass-1 { A compile-time
        error occurs if the name of a final class appears
        in the extends clause of another class declaration } {
    
    compile [saveas T8112is1.java {
final class T8112is1_super {}
class T8112is1 extends T8112is1_super {}
    }]

} {FAIL}
Test Case: 8.1.1.2-invalid-subclass-2
A final class can not be extended via an anymous innerclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.1.2-invalid-subclass-2 { A final
        class can not be extended via an
        anymous innerclass } {
    
    compile [saveas T8112is2.java {
final class T8112is2 {
    Object o = new T8112is2() {};
}
    }]

} {FAIL}

8.1.3

Directory : tests/jls/classes/class-declaration/superclasses-and-subclasses


Test Case: 8.1.3-circular-1
Circular dependencies are illegal

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.3-circular-1 { Circular dependencies are illegal } {
    
    compile [saveas T813c1.java {
class T813c1 implements T813c1.Inner {
    interface Inner {}
}
    }]

} {FAIL}
Test Case: 8.1.3-circular-2
Circular dependencies are illegal

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.3-circular-2 { Circular dependencies are illegal } {
    
    compile [saveas T813c2.java {
class T813c2 extends T813c2.Inner {
    class Inner {}
}
    }]

} {FAIL}
Test Case: 8.1.3-circular-3
Circular dependencies are illegal

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.3-circular-3 { Circular dependencies are illegal } {
    
    compile [saveas T813c3.java {
class T813c3 extends T813c3 {}
    }]

} {FAIL}
Test Case: 8.1.3-circular-4
Circular dependencies are illegal

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.3-circular-4 { Circular dependencies are illegal } {
    
    compile [saveas T813c4.java {
class T813c4_1 extends T813c4_2 {}
class T813c4_2 extends T813c4_1 {}
    }]

} {FAIL}
Test Case: 8.1.3-circular-5
Circular dependencies are illegal

Expected Result: FAIL

Regression Test:

tcltest::test 8.1.3-circular-5 { Circular dependencies are illegal } {
    
    compile [saveas T813c5.java {
class T813c5_1 implements T813c5_2.Inner2 {
    interface Inner1 {}
}
class T813c5_2 {
    interface Inner2 extends T813c5_1.Inner1 {}
}
    }]

} {FAIL}

8.2

Directory : tests/jls/classes/class-members


Test Case: 8.2-accessibility-inherited-member-1
members declared public are accessible in a subclass

Expected Result: PASS

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-1 { members
        declared public are accessible in a subclass } {
    
    saveas T82aim1.java {
class T82aim1 {
    public int foo;
}

class T82aim1_Test extends T82aim1 {
    void bar() { foo = 0; }
}
    }

    compile T82aim1.java

} {PASS}
Test Case: 8.2-accessibility-inherited-member-2
members declared public are accessible in a subclass

Expected Result: PASS

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-2 { members
        declared public are accessible in a subclass } {
    
    saveas T82aim2.java {
class T82aim2 {
    public void foo() {}
}

class T82aim2_Test extends T82aim2 {
    void bar() { foo(); }
}
    }

    compile T82aim2.java

} {PASS}
Test Case: 8.2-accessibility-inherited-member-3
members declared protected are accessible in a subclass

Expected Result: PASS

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-3 { members
        declared protected are accessible in a subclass } {
    
    saveas T82aim3.java {
class T82aim3 {
    protected int foo;
}

class T82aim3_Test extends T82aim3 {
    void bar() { foo = 0; }
}
    }

    compile T82aim3.java

} {PASS}
Test Case: 8.2-accessibility-inherited-member-4
members declared protected are accessible in a subclass

Expected Result: PASS

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-4 { members
        declared protected are accessible in a subclass } {
    
    saveas T82aim4.java {
class T82aim4 {
    protected void foo() {}
}

class T82aim4_Test extends T82aim4 {
    void bar() { foo(); }
}
    }

    compile T82aim4.java

} {PASS}
Test Case: 8.2-accessibility-inherited-member-5
members declared private are not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-5 { members
        declared private are not accessible in a subclass } {
    
    saveas T82aim5.java {
class T82aim5 {
    private int foo;
}

class T82aim5_Test extends T82aim5 {
    void bar() { foo = 0; }
}
    }

    compile T82aim5.java

} {FAIL}
Test Case: 8.2-accessibility-inherited-member-6
members declared private are not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-6 { members
        declared private are not accessible in a subclass } {
    
    saveas T82aim6.java {
class T82aim6 {
    private void foo() {}
}

class T82aim6_Test extends T82aim6 {
    void bar() { foo(); }
}
    }

    compile T82aim6.java

} {FAIL}
Test Case: 8.2-accessibility-inherited-member-7
members with default protection are accessible in a subclass

Expected Result: PASS

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-7 { members
        with default protection are accessible in a subclass } {
    
    saveas T82aim7.java {
class T82aim7 {
    int foo;
}

class T82aim7_Test extends T82aim7 {
    void bar() { foo = 0; }
}
    }

    compile T82aim7.java

} {PASS}
Test Case: 8.2-accessibility-inherited-member-8
members with default protection are accessible in a subclass

Expected Result: PASS

Regression Test:

tcltest::test 8.2-accessibility-inherited-member-8 { members
        with default protection are accessible in a subclass } {
    
    saveas T82aim8.java {
class T82aim8 {
    void foo() {}
}

class T82aim8_Test extends T82aim8 {
    void bar() { foo(); }
}
    }

    compile T82aim8.java

} {PASS}
Test Case: 8.2-constructor-not-inherited-1
A constructor is not a class member and is therefore not inherited

Expected Result: FAIL

Regression Test:

tcltest::test 8.2-constructor-not-inherited-1 { A constructor
        is not a class member and is therefore not inherited } {
    
    saveas T82cni1.java {
class T82cni1 {
    public T82cni1() {}
    public T82cni1(int value) {}
}

class T82cni1_Test extends T82cni1 {
    Object o = new T82cni1_Test(0);
}
    }

    compile T82cni1.java

} {FAIL}

8.4.5

Directory : tests/jls/classes/method-declarations/method-body


Test Case: 8.4.5-1
{} is a valid method body

Expected Result: PASS

Regression Test:

tcltest::test 8.4.5-1 { {} is a valid method body} {
    
    compile [saveas EmptyBlockMethodBody.java  {
public class EmptyBlockMethodBody {
    public void foo() {}
}
}]

} {PASS}
Test Case: 8.4.5-2
only a native or abstract method can have no method body

Expected Result: FAIL

Regression Test:

tcltest::test 8.4.5-2 { only a native or abstract method can have no method body } {
    
    compile [saveas InvalidEmptyMethodBody.java  {
public class InvalidEmptyMethodBody {
    public void foo() ;
}
}]

} {FAIL}
Test Case: 8.4.5-3
a native method does not have a body

Expected Result: PASS

Regression Test:

tcltest::test 8.4.5-3 { a native method does not have a body } {
    
    compile [saveas EmptyNativeMethodBody.java  {
public class EmptyNativeMethodBody {
    public native void foo();
}
}]

} {PASS}
Test Case: 8.4.5-4
a native method can not have a body

Expected Result: FAIL

Regression Test:

tcltest::test 8.4.5-4 { a native method can not have a body } {
    
    compile [saveas InvalidNativeMethodBody.java  {
public class InvalidNativeMethodBody {
    public native void foo() {}
}
}]

} {FAIL}
Test Case: 8.4.5-5
an abstract method does not have a body

Expected Result: PASS

Regression Test:

tcltest::test 8.4.5-5 { an abstract method does not have a body } {
    
    compile [saveas EmptyAbstractMethodBody.java  {
public abstract class EmptyAbstractMethodBody {
    public abstract void foo();
}
}]

} {PASS}
Test Case: 8.4.5-6
an abstract method can not have a body

Expected Result: FAIL

Regression Test:

tcltest::test 8.4.5-6 { an abstract method can not have a body } {
    
    compile [saveas InvalidAbstractMethodBody.java  {
public abstract class InvalidAbstractMethodBody {
    public abstract void foo() {}
}
}]

} {FAIL}
Test Case: 8.4.5-7
non void method without a return is invalid

Expected Result: FAIL

Regression Test:

tcltest::test 8.4.5-7 { non void method without a return is invalid } {
    
    compile [saveas NoReturnInNonVoid.java  {
public class NoReturnInNonVoid {
    public boolean foo() {}
}
}]

} {FAIL}
Test Case: 8.4.5-8
a void method with a non expression return is valid

Expected Result: PASS

Regression Test:

tcltest::test 8.4.5-8 { a void method with a non expression return is valid } {
    
    compile [saveas NoExpressionReturnInVoid.java  {
public class NoExpressionReturnInVoid {
    public void foo() { return; }
}
}]

} {PASS}
Test Case: 8.4.5-9
a return with no expression in a non void method is invalid

Expected Result: FAIL

Regression Test:

tcltest::test 8.4.5-9 { a return with no expression in a non void method is invalid } {
    
    compile [saveas ConflictingReturnInNonVoid.java  {
public class ConflictingReturnInNonVoid {
    public boolean foo() {
        int i = 0;
        if (i == 1) {
            return true;
        } else {
            return;
        }
    }
}
}]

} {FAIL}
Test Case: 8.4.5-10
a return with an expression in a void method is invalid

Expected Result: FAIL

Regression Test:

tcltest::test 8.4.5-10 { a return with an expression in a void method is invalid } {
    
    compile [saveas ConflictingReturnInVoid.java  {
public class ConflictingReturnInVoid {
    public void foo() {
        int i = 0;
        if (i == 1) {
            return true;
        } else {
            return;
        }
    }
}
}]

} {FAIL}
Test Case: 8.4.5-11
a method with an exceptional exit does not require a return ?

Expected Result: PASS

Regression Test:

tcltest::test 8.4.5-11 { a method with an exceptional exit does not require a return ? } {
    
    compile [saveas ExceptionalReturnInNonVoid.java  {
public class ExceptionalReturnInNonVoid {
    public boolean foo() { throw new RuntimeException("foo()"); }
}
}]

} {PASS}

8.5.1

Directory : tests/jls/classes/member-type-declarations/access-modifiers


Test Case: 8.5.1-valid-modifier-1
public is a valid ClassModifier for a member class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.1-valid-modifier-1 { public is a
        valid ClassModifier for a member class } {
    
    empty_class T851vm1 {
    public class Inner {}
    }

} {PASS}
Test Case: 8.5.1-valid-modifier-2
protected is a valid ClassModifier for a member class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.1-valid-modifier-2 { protected
        is a valid ClassModifier for a member class } {
    
    empty_class T851vm2 {
    protected class Inner {}
    }

} {PASS}
Test Case: 8.5.1-valid-modifier-3
private is a valid ClassModifier for a member class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.1-valid-modifier-3 { private
        is a valid ClassModifier for a member class } {
    
    empty_class T851vm3 {
    protected class Inner {}
    }

} {PASS}
Test Case: 8.5.1-valid-modifier-4
static is a valid ClassModifier for a member class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.1-valid-modifier-4 { static
        is a valid ClassModifier for a member class } {
    
    empty_class T851vm4 {
    static class Member {}
    }

} {PASS}
Test Case: 8.5.1-valid-modifier-5
strictfp is a valid ClassModifier for a member class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.1-valid-modifier-5 { strictfp
        is a valid ClassModifier for a member class } {
    
    empty_class T851vm5 {
    strictfp class Member {}
    }

} {PASS}
Test Case: 8.5.1-duplicate-modifier-1
compile time error to specify a class modifier twice

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-duplicate-modifier-1 { compile time
        error to specify a class modifier twice } {
    
    empty_class T851dm1 {
    static static class Member {}
    }

} {FAIL}
Test Case: 8.5.1-duplicate-modifier-2
compile time error to specify a class modifier twice

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-duplicate-modifier-2 { compile time
        error to specify a class modifier twice } {
    
    empty_class T851dm2 {
    protected protected class Inner {}
    }

} {FAIL}
Test Case: 8.5.1-duplicate-modifier-3
compile time error to specify a class modifier twice

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-duplicate-modifier-3 { compile time
        error to specify a class modifier twice } {
    
    empty_class T851dm3 {
    private private class Inner {}
    }

} {FAIL}
Test Case: 8.5.1-conflicting-modifier-1
conflicting modifiers must generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-conflicting-modifier-1 { conflicting
        modifiers must generate a compile time error } {
    
    empty_class T851cm1 {
    public private class Inner {}
    }

} {FAIL}
Test Case: 8.5.1-conflicting-modifier-2
conflicting modifiers must generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-conflicting-modifier-2 { conflicting
        modifiers must generate a compile time error } {
    
    empty_class T851cm2 {
    public protected class Inner {}
    }

} {FAIL}
Test Case: 8.5.1-conflicting-modifier-3
conflicting modifiers must generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-conflicting-modifier-3 { conflicting
        modifiers must generate a compile time error } {
    
    empty_class T851cm3 {
    protected public class Inner {}
    }

} {FAIL}
Test Case: 8.5.1-conflicting-modifier-4
conflicting modifiers must generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-conflicting-modifier-4 { conflicting
        modifiers must generate a compile time error } {
    
    empty_class T851cm4 {
    protected private class Inner {}
    }

} {FAIL}
Test Case: 8.5.1-conflicting-modifier-5
conflicting modifiers must generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-conflicting-modifier-5 { conflicting
        modifiers must generate a compile time error } {
    
    empty_class T851cm5 {
    private public class Inner {}
    }

} {FAIL}
Test Case: 8.5.1-conflicting-modifier-6
conflicting modifiers must generate a compile time error

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.1-conflicting-modifier-6 { conflicting
        modifiers must generate a compile time error } {
    
    empty_class T851cm6 {
    private protected class Inner {}
    }

} {FAIL}

8.5.2

Directory : tests/jls/classes/member-type-declarations/static-member-type-declarations


Test Case: 8.5.2-static-member-usage-1
a member type with the static modifier may use static members of the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-static-member-usage-1 { a member type
        with the static modifier may use static members
        of the enclosing class } {
    
    empty_class T852smu1 {
    static int foo;

    static class T852smu1_Test {
        T852smu1_Test() { foo = 0; }
    }
    }

} {PASS}
Test Case: 8.5.2-static-member-usage-2
a member type with the static modifier may use static members of the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-static-member-usage-2 { a member type
        with the static modifier may use static members
        of the enclosing class } {
    
    empty_class T852smu2 {
    static void foo() {}

    static class T852smu2_Test {
        T852smu2_Test() { foo(); }
    }
    }

} {PASS}
Test Case: 8.5.2-non-static-member-usage-1
It is a compile-time error if a static class contains a usage of a non-static member of the enclosing class

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.2-non-static-member-usage-1 { It is a
        compile-time error if a static class contains a
        usage of a non-static member of the enclosing class } {
    
    empty_class T852nsmu1 {
    int foo;

    static class T852nsmu1_Test {
        T852nsmu1_Test() { foo = 0; }
    }
    }

} {FAIL}
Test Case: 8.5.2-non-static-member-usage-2
It is a compile-time error if a static class contains a usage of a non-static member of the enclosing class

Expected Result: FAIL

Regression Test:

tcltest::test 8.5.2-non-static-member-usage-2 { It is a
        compile-time error if a static class contains a
        usage of a non-static member of the enclosing class } {
    
    empty_class T852nsmu2 {
    void foo() {}

    static class T852nsmu2_Test {
        T852nsmu2_Test() { foo(); }
    }
    }

} {FAIL}
Test Case: 8.5.2-accessible-static-member-usage-1
a member type with the static modifer may access private static members of the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-accessible-static-member-usage-1 {
        a member type with the static modifer may access
        private static members of the enclosing class } {
    
    empty_class T852asmu1 {
    private static int foo;

    static class T852asmu1_Test {
        T852asmu1_Test() { foo = 0; }
    }
    }

} {PASS}
Test Case: 8.5.2-accessible-static-member-usage-2
a member type with the static modifer may access private static members of the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-accessible-static-member-usage-2 {
        a member type with the static modifer may access
        private static members of the enclosing class } {
    
    empty_class T852asmu2 {
    private static void foo() {}

    static class T852asmu2_Test {
        T852asmu2_Test() { foo(); }
    }
    }

} {PASS}
Test Case: 8.5.2-inherited-non-static-member-usage-1
a static member type may use non-static members of a superclass that happens to be the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-inherited-non-static-member-usage-1 {
        a static member type may use non-static members of
        a superclass that happens to be the enclosing class } {
    
    empty_class T852insmu1 {
    int foo;

    static class T852insmu1_Test extends T852insmu1 {
        T852insmu1_Test() { foo = 0; }
    }
    }

} {PASS}
Test Case: 8.5.2-inherited-non-static-member-usage-2
a static member type may use non-static members of a superclass that happens to be the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-inherited-non-static-member-usage-2 {
        a static member type may use non-static members of
        a superclass that happens to be the enclosing class } {
    
    empty_class T852insmu2 {
    void foo() {}

    static class T852insmu2_Test extends T852insmu2 {
        T852insmu2_Test() { foo(); }
    }
    }

} {PASS}
Test Case: 8.5.2-accessible-inherited-non-static-member-usage-1
a static member type may use private non-static members of a superclass that happens to be the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-accessible-inherited-non-static-member-usage-1 {
        a static member type may use private non-static members of
        a superclass that happens to be the enclosing class } {
    
    empty_class T852ainsmu1 {
    private int foo;

    static class T852ainsmu1_Test extends T852ainsmu1 {
        T852ainsmu1_Test() { foo = 0; }
    }
    }

} {PASS}
Test Case: 8.5.2-accessible-inherited-non-static-member-usage-2
a static member type may use private non-static members of a superclass that happens to be the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.5.2-accessible-inherited-non-static-member-usage-2 {
        a static member type may use private non-static members of
        a superclass that happens to be the enclosing class } {
    
    empty_class T852ainsmu2 {
    private void foo() {}

    static class T852ainsmu2_Test extends T852ainsmu2 {
        T852ainsmu2_Test() { foo(); }
    }
    }

} {PASS}

8.8

Directory : tests/jls/classes/constructor-declarations


Test Case: 8.8-simpletypename-1
SimpleTypeName in the ConstructorDeclarator must be the simple name of the class that contains the constructor declaration

Expected Result: PASS

Regression Test:

tcltest::test 8.8-simpletypename-1 { SimpleTypeName in the
        ConstructorDeclarator must be the simple name of the
        class that contains the constructor declaration } {
    
    empty_class T88stn1 "T88stn1() {}"

} {PASS}
Test Case: 8.8-simpletypename-2
SimpleTypeName in the ConstructorDeclarator must be the simple name of the class that contains the constructor declaration

Expected Result: FAIL

Regression Test:

tcltest::test 8.8-simpletypename-2 { SimpleTypeName in the
        ConstructorDeclarator must be the simple name of the
        class that contains the constructor declaration } {
    
    empty_class T88stn2 "not_ctor() {}"

} {FAIL}
Test Case: 8.8-example-1
JLS example

Expected Result: PASS

Regression Test:

tcltest::test 8.8-example-1 { JLS example } {
    
    empty_class Point {
        int x, y;
        Point(int x, int y) { this.x = x; this.y = y; }
    }

} {PASS}

8.8.1

Directory : tests/jls/classes/constructor-declarations/formal-parameters


Test Case: 8.8.1-formal-parameters-1
See 8.4.1

Expected Result: PASS

Regression Test:

tcltest::test 8.8.1-formal-parameters-1 { See 8.4.1 } {
    
    empty_class T881fp1 "T881fp1() {}"

} {PASS}
Test Case: 8.8.1-formal-parameters-2
See 8.4.1

Expected Result: PASS

Regression Test:

tcltest::test 8.8.1-formal-parameters-2 { See 8.4.1 } {
    
    empty_class T881fp2 "T881fp2(int i) {}"

} {PASS}
Test Case: 8.8.1-formal-parameters-3
See 8.4.1

Expected Result: PASS

Regression Test:

tcltest::test 8.8.1-formal-parameters-3 { See 8.4.1 } {
    
    empty_class T881fp3 "T881fp3(int i, Object j) {}"

} {PASS}
Test Case: 8.8.1-formal-parameters-4
See 8.4.1

Expected Result: PASS

Regression Test:

tcltest::test 8.8.1-formal-parameters-4 { See 8.4.1 } {
    
    empty_class T881fp4 "T881fp4(int i, final Object j) {}"

} {PASS}
Test Case: 8.8.1-formal-parameters-5
See 8.4.1

Expected Result: PASS

Regression Test:

tcltest::test 8.8.1-formal-parameters-5 { See 8.4.1 } {
    
    empty_class T881fp5 {T881fp5(int[] arr, Object j) {}}

} {PASS}
Test Case: 8.8.1-formal-parameters-6
See 8.4.1

Expected Result: PASS

Regression Test:

tcltest::test 8.8.1-formal-parameters-6 { See 8.4.1 } {
    
    empty_class T881fp6 {T881fp6(final int[] arr) {}}

} {PASS}
Test Case: 8.8.1-invalid-formal-parameters-1
See 8.4.1

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.1-invalid-formal-parameters-1 { See 8.4.1 } {
    
    empty_class T881ifp1 "T881ifp1(int i, ) {}"

} {FAIL}
Test Case: 8.8.1-invalid-formal-parameters-2
See 8.4.1

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.1-invalid-formal-parameters-2 { See 8.4.1 } {
    
    empty_class T881ifp2 "T881ifp2(int i, foo) {}"

} {FAIL}
Test Case: 8.8.1-invalid-formal-parameters-3
See 8.4.1

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.1-invalid-formal-parameters-3 { See 8.4.1 } {
    
    empty_class T881ifp3 "T881ifp3(int i, int) {}"

} {FAIL}
Test Case: 8.8.1-invalid-formal-parameters-4
See 8.4.1

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.1-invalid-formal-parameters-4 { See 8.4.1 } {
    
    empty_class T881ifp4 "T881ifp4(int i, final int) {}"

} {FAIL}

8.8.2

Directory : tests/jls/classes/constructor-declarations/constructor-signature


Test Case: 8.8.2-signature-1
The signature of a constructor consists of the number and types of formal parameters to the constructor

Expected Result: PASS

Regression Test:

tcltest::test 8.8.2-signature-1 { The signature of a
        constructor consists of the number and types
        of formal parameters to the constructor } {
    
    empty_class T882s1 {
T882s1() {}
T882s1(int i) {}
T882s1(Object o) {}
    }

} {PASS}
Test Case: 8.8.2-invalid-signature-1
A class may not declare two constructors with the same signature, or a compile-time error occurs

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.2-invalid-signature-1 { A class may not
        declare two constructors with the same signature,
        or a compile-time error occurs } {
    
    empty_class T882is1 {
T882is1(int i) {}
T882is1(int j) {}
    }

} {FAIL}

8.8.3

Directory : tests/jls/classes/constructor-declarations/constructor-modifiers


Test Case: 8.8.3-modifiers-1
ConstructorModifier can be public, protected, or private

Expected Result: PASS

Regression Test:

tcltest::test 8.8.3-modifiers-1 { ConstructorModifier can
        be public, protected, or private } {
    
    empty_class T883m1 "public T883m1() {}"

} {PASS}
Test Case: 8.8.3-modifiers-2
ConstructorModifier can be public, protected, or private

Expected Result: PASS

Regression Test:

tcltest::test 8.8.3-modifiers-2 { ConstructorModifier can
        be public, protected, or private } {
    
    empty_class T883m2 "protected T883m2() {}"

} {PASS}
Test Case: 8.8.3-modifiers-3
ConstructorModifier can be public, protected, or private

Expected Result: PASS

Regression Test:

tcltest::test 8.8.3-modifiers-3 { ConstructorModifier can
        be public, protected, or private } {
    
    empty_class T883m3 "private T883m3() {}"

} {PASS}
Test Case: 8.8.3-duplicate-modifiers-1
A compile-time error occurs if the same modifier appears more than once in a constructor declaration

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-duplicate-modifiers-1 { A compile-time
        error occurs if the same modifier appears more than
       once in a constructor declaration } {
    
    empty_class T883dm1 "public public T883dm1() {}"

} {FAIL}
Test Case: 8.8.3-duplicate-modifiers-2
A compile-time error occurs if the same modifier appears more than once in a constructor declaration

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-duplicate-modifiers-2 { A compile-time
        error occurs if the same modifier appears more than
       once in a constructor declaration } {
    
    empty_class T883dm2 "protected protected T883dm2() {}"

} {FAIL}
Test Case: 8.8.3-duplicate-modifiers-3
A compile-time error occurs if the same modifier appears more than once in a constructor declaration

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-duplicate-modifiers-3 { A compile-time
        error occurs if the same modifier appears more than
       once in a constructor declaration } {
    
    empty_class T883dm3 "private private T883dm3() {}"

} {FAIL}
Test Case: 8.8.3-multiple-modifiers-1
A compile-time error occurs if a constructor declaration has more than one of public, protected, and private

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-multiple-modifiers-1 { A compile-time
        error occurs if a constructor declaration has more
        than one of  public, protected, and private } {
    
    empty_class T883mm1 "public protected T883mm1() {}"

} {FAIL}
Test Case: 8.8.3-multiple-modifiers-2
A compile-time error occurs if a constructor declaration has more than one of public, protected, and private

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-multiple-modifiers-2 { A compile-time
        error occurs if a constructor declaration has more
        than one of  public, protected, and private } {
    
    empty_class T883mm2 "public private T883mm2() {}"

} {FAIL}
Test Case: 8.8.3-multiple-modifiers-3
A compile-time error occurs if a constructor declaration has more than one of public, protected, and private

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-multiple-modifiers-3 { A compile-time
        error occurs if a constructor declaration has more
        than one of  public, protected, and private } {
    
    empty_class T883mm3 "protected public T883mm3() {}"

} {FAIL}
Test Case: 8.8.3-multiple-modifiers-4
A compile-time error occurs if a constructor declaration has more than one of public, protected, and private

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-multiple-modifiers-4 { A compile-time
        error occurs if a constructor declaration has more
        than one of  public, protected, and private } {
    
    empty_class T883mm4 "protected private T883mm4() {}"

} {FAIL}
Test Case: 8.8.3-multiple-modifiers-5
A compile-time error occurs if a constructor declaration has more than one of public, protected, and private

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-multiple-modifiers-5 { A compile-time
        error occurs if a constructor declaration has more
        than one of  public, protected, and private } {
    
    empty_class T883mm5 "private public T883mm5() {}"

} {FAIL}
Test Case: 8.8.3-multiple-modifiers-6
A compile-time error occurs if a constructor declaration has more than one of public, protected, and private

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-multiple-modifiers-6 { A compile-time
        error occurs if a constructor declaration has more
        than one of  public, protected, and private } {
    
    empty_class T883mm6 "private protected T883mm6() {}"

} {FAIL}
Test Case: 8.8.3-invalid-modifiers-1
A constructor cannot be abstract, static, final, native, strictfp, or synchronized

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-invalid-modifiers-1 { A constructor
        cannot be abstract, static, final, native, strictfp,
        or synchronized } {
    
    empty_class T883im1 "abstract T883im1() {}"

} {FAIL}
Test Case: 8.8.3-invalid-modifiers-2
A constructor cannot be abstract, static, final, native, strictfp, or synchronized

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-invalid-modifiers-2 { A constructor
        cannot be abstract, static, final, native, strictfp,
        or synchronized } {
    
    empty_class T883im2 "static T883im2() {}"

} {FAIL}
Test Case: 8.8.3-invalid-modifiers-3
A constructor cannot be abstract, static, final, native, strictfp, or synchronized

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-invalid-modifiers-3 { A constructor
        cannot be abstract, static, final, native, strictfp,
        or synchronized } {
    
    empty_class T883im3 "final T883im3() {}"

} {FAIL}
Test Case: 8.8.3-invalid-modifiers-4
A constructor cannot be abstract, static, final, native, strictfp, or synchronized

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-invalid-modifiers-4 { A constructor
        cannot be abstract, static, final, native, strictfp,
        or synchronized } {
    
    empty_class T883im4 "native T883im4() {}"

} {FAIL}
Test Case: 8.8.3-invalid-modifiers-5
A constructor cannot be abstract, static, final, native, strictfp, or synchronized

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-invalid-modifiers-5 { A constructor
        cannot be abstract, static, final, native, strictfp,
        or synchronized } {
    
    empty_class T883im5 "strictfp T883im5() {}"

} {FAIL}
Test Case: 8.8.3-invalid-modifiers-6
A constructor cannot be abstract, static, final, native, strictfp, or synchronized

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.3-invalid-modifiers-6 { A constructor
        cannot be abstract, static, final, native, strictfp,
        or synchronized } {
    
    empty_class T883im6 "synchronized T883im6() {}"

} {FAIL}

8.8.5

Directory : tests/jls/classes/constructor-declarations/constructor-body


Test Case: 8.8.5-return-statement-1
A return statement may be used in the body of a constructor if it does not include an expression

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5-return-statement-1 { A return statement may be
        used in the body of a constructor if it does not include
        an expression } {
    
    empty_class T885rs1 "T885rs1() { return; }"

} {PASS}
Test Case: 8.8.5-return-statement-2
A return statement may be used in the body of a constructor if it does not include an expression

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5-return-statement-2 { A return statement may be
        used in the body of a constructor if it does not include
        an expression } {
    
    empty_class T885rs2 "T885rs2() { return 1; }"

} {FAIL}
Test Case: 8.8.5-example-1
JLS example

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5-example-1 { JLS example } {
    
    saveas Point.java {
class Point {
           int x, y;
           Point(int x, int y) { this.x = x; this.y = y; }
   }
   class ColoredPoint extends Point {
           static final int WHITE = 0, BLACK = 1;
           int color;
           ColoredPoint(int x, int y) {
                   this(x, y, WHITE);
           }
           ColoredPoint(int x, int y, int color) {
                   super(x, y);
                   this.color = color;
           }
   }
}

    compile Point.java

} {PASS}

8.8.5.1

Directory : tests/jls/classes/constructor-declarations/constructor-body/explicit-constructor-invocations


Test Case: 8.8.5.1-before-block-statements-this-1
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-before-block-statements-this-1 { An
        ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    empty_class T8851bbst1 {
T8851bbst1() {}
T8851bbst1(int i) { this(); {} }
     }

} {PASS}
Test Case: 8.8.5.1-before-block-statements-this-2
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-before-block-statements-this-2 { An
        ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    empty_class T8851bbst2 {
T8851bbst2() {}
T8851bbst2(int i) { {} this(); }
     }

} {FAIL}
Test Case: 8.8.5.1-before-block-statements-this-3
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-before-block-statements-this-3 { An
        ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    empty_class T8851bbst3 {
T8851bbst3() {}
T8851bbst3(int i) { ; this(); }
     }

} {FAIL}
Test Case: 8.8.5.1-before-block-statements-super-1
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-before-block-statements-super-1 { An
        ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    empty_class T8851bbss1 {
T8851bbss1(int i) { super(); {} }
     }

} {PASS}
Test Case: 8.8.5.1-before-block-statements-super-2
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-before-block-statements-super-2 { An
        ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    empty_class T8851bbss2 {
T8851bbss2(int i) { {} super(); }
     }

} {FAIL}
Test Case: 8.8.5.1-before-block-statements-super-3
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-before-block-statements-super-3 { An
        ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    empty_class T8851bbss3 {
T8851bbss3(int i) { ; super(); }
     }

} {FAIL}
Test Case: 8.8.5.1-multiple-this-invocations-1
It is a compile-time error for a constructor to invoke itself

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-multiple-this-invocations-1 { It is
        a compile-time error for a constructor to invoke itself } {
    
    empty_class T8851mti1 {
T8851mti1() { this(); }
     }

} {FAIL}
Test Case: 8.8.5.1-multiple-this-invocations-2
It is a compile-time error for a constructor to indirectly invoke itself through a series of one or more explicit constructor invocations involving this

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-multiple-this-invocations-2 { It is
        a compile-time error for a constructor to indirectly
        invoke itself through a series of one or more
        explicit constructor invocations involving this } {
    
    empty_class T8851mti2 {
T8851mti2() { this(0); }
T8851mti2(int i) { this(); }
     }

} {FAIL}
Test Case: 8.8.5.1-multiple-this-invocations-3
It is a compile-time error for a constructor to indirectly invoke itself through a series of one or more explicit constructor invocations involving this

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-multiple-this-invocations-3 { It is
        a compile-time error for a constructor to indirectly
        invoke itself through a series of one or more
        explicit constructor invocations involving this } {
    
    empty_class T8851mti3 {
T8851mti3() { this(0); }
T8851mti3(int i) { this("noggy"); }
T8851mti3(String s) { this(true); }
T8851mti3(boolean state) { this(); }
     }

} {FAIL}
Test Case: 8.8.5.1-accessible-implicit-super-invocation-1
If a constructor body does not begin with an explicit constructor invocation, then the constructor body is implicitly assumed by the compiler to begin with a superclass constructor invocation

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-implicit-super-invocation-1 {
        If a constructor body does not begin with an explicit
        constructor invocation, then the constructor
        body is implicitly assumed by the compiler to
        begin with a superclass constructor invocation } {
    
    empty_class T8851aisi1 {
T8851aisi1(int i) {}
     }

} {PASS}
Test Case: 8.8.5.1-accessible-implicit-super-invocation-2
An implicit constructor for an inner class can gain access to a private constructor in the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-implicit-super-invocation-2 {
        An implicit constructor for an inner class can gain
        access to a private constructor in the enclosing class } {
    
    empty_class T8851aisi2 { 
    private T8851aisi2() {}

    static class T8851aisi2_Inner extends T8851aisi2 {
        T8851aisi2_Inner() {}
    }
    }

} {PASS}
Test Case: 8.8.5.1-accessible-implicit-super-invocation-3
An implicit constructor for an inner class can gain access to a private constructor in the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-implicit-super-invocation-3 {
        An implicit constructor for an inner class can gain
        access to a private constructor in the enclosing class } {
    
    empty_class T8851aisi3 { 
    private T8851aisi3() {}

    class T8851aisi3_Inner extends T8851aisi3 {
        T8851aisi3_Inner() {}
    }
    }

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-1
explicit superclass constructor invocation

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-1 {
        explicit superclass constructor invocation } {
    
    empty_class T8851aesi1 {
T8851aesi1(int i) { super(); }
     }

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-2
An explicit constructor for an inner class can gain access to a private constructor in the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-2 {
        An explicit constructor for an inner class can gain
        access to a private constructor in the enclosing class } {
    
    empty_class T8851aesi2 { 
    private T8851aesi2() {}

    static class T8851aesi2_Inner extends T8851aesi2 {
        T8851aesi2_Inner() { super(); }
    }
    }

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-3
An explicit constructor for an inner class can gain access to a private constructor in the enclosing class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-3 {
        An explicit constructor for an inner class can gain
        access to a private constructor in the enclosing class } {
    
    empty_class T8851aesi3 { 
    private T8851aesi3() {}

    class T8851aesi3_Inner extends T8851aesi3 {
        T8851aesi3_Inner() { super(); }
    }
    }

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-args-1
explicit superclass constructor invocation

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-args-1 {
        explicit superclass constructor invocation } {
    

    saveas T8851aesia1.java {
class T8851aesia1_super {
    T8851aesia1_super(int i) {}
}
class T8851aesia1 extends T8851aesia1_super {
    T8851aesia1() { super(1); }
}
}

    compile T8851aesia1.java

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-args-2
explicit superclass constructor invocation

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-args-2 {
        explicit superclass constructor invocation } {
    

    saveas T8851aesia2.java {
class T8851aesia2_super {
    T8851aesia2_super(Object o) {}
}
class T8851aesia2 extends T8851aesia2_super {
    T8851aesia2() { super(null); }
}
}

    compile T8851aesia2.java

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-args-3
a private constructor in an enclosing class is accessible

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-args-3 {
        a private constructor in an enclosing class is accessible } {
    

    saveas T8851aesia3.java {
class T8851aesia3_super {
    private T8851aesia3_super(int i) {}

    static class T8851aesia3 extends T8851aesia3_super {
        T8851aesia3() { super(1); }
    }
}
}

    compile T8851aesia3.java

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-args-4
a private constructor in an enclosing class is accessible

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-args-4 {
        a private constructor in an enclosing class is accessible } {
    

    saveas T8851aesia4.java {
class T8851aesia4_super {
    private T8851aesia4_super(Object o) {}

    static class T8851aesia4 extends T8851aesia4_super {
        T8851aesia4() { super(null); }
    }
}
}

    compile T8851aesia4.java

} {PASS}
Test Case: 8.8.5.1-accessible-explicit-super-invocation-args-5
pass lots of types to multiple accessible constructors

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-accessible-explicit-super-invocation-args-5 {
        pass lots of types to multiple accessible constructors } {
    

    saveas T8851aesia5.java {
class T8851aesia5_super {
    private T8851aesia5_super(Object o) {}
    private T8851aesia5_super(String s) {}
    private T8851aesia5_super(boolean state) {}
    private T8851aesia5_super(int i) {}
    private T8851aesia5_super(long l) {}
    private T8851aesia5_super(String s, char c) {}
    private T8851aesia5_super(double d, short s) {}
    private T8851aesia5_super(byte b, float f) {}

    static class T8851aesia5_o extends T8851aesia5_super {
        T8851aesia5_o() { super( new Object() ); }
    }
    static class T8851aesia5_s extends T8851aesia5_super {
        T8851aesia5_s() { super("hello"); }
    }
    class T8851aesia5_b extends T8851aesia5_super {
        T8851aesia5_b() { super(true); }
    }
    class T8851aesia5_i extends T8851aesia5_super {
        T8851aesia5_i() { super(1); }
    }
    Object l_obj = new T8851aesia5_super(0L) {
        void foo() {}
    };
    Object sb_obj = new T8851aesia5_super("hello", 'b') {
        void foo() {}
    };
    Object bf_obj = new T8851aesia5_super((byte) 2, 1.0F) {
        void foo() {}
    };
    
}
}

    compile T8851aesia5.java

} {PASS}
Test Case: 8.8.5.1-inaccessible-implicit-super-invocation-1
A private constructor is not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-inaccessible-implicit-super-invocation-1 {
        A private constructor is not accessible in a subclass } {
    
    saveas T8851iisi1.java {
class T8851iisi1_super {
    private T8851iisi1_super() {}
}

class T8851iisi1 extends T8851iisi1_super {
    T8851iisi1() {}
}
}

    compile T8851iisi1.java

} {FAIL}
Test Case: 8.8.5.1-inaccessible-explicit-super-invocation-1
A private constructor is not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-inaccessible-explicit-super-invocation-1 {
        A private constructor is not accessible in a subclass } {
    
    saveas T8851iesi1.java {
class T8851iesi1_super {
    private T8851iesi1_super() {}
}

class T8851iesi1 extends T8851iesi1_super {
    T8851iesi1() { super(); }
}
}

    compile T8851iesi1.java

} {FAIL}
Test Case: 8.8.5.1-inaccessible-explicit-super-invocation-args-1
A private constructor is not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-inaccessible-explicit-super-invocation-args-1 {
        A private constructor is not accessible in a subclass } {
    
    saveas T8851iesia1.java {
class T8851iesia1_super {
    private T8851iesia1_super(int i) {}
}

class T8851iesia1 extends T8851iesia1_super {
    T8851iesia1() { super(1); }
}
}

    compile T8851iesia1.java

} {FAIL}
Test Case: 8.8.5.1-inaccessible-explicit-super-invocation-args-2
A private constructor is not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-inaccessible-explicit-super-invocation-args-2 {
        A private constructor is not accessible in a subclass } {
    
    saveas T8851iesia2.java {
class T8851iesia2_super {
    private T8851iesia2_super(Object o) {}
}

class T8851iesia2 extends T8851iesia2_super {
    T8851iesia2() { super(null); }
}
}

    compile T8851iesia2.java

} {FAIL}
Test Case: 8.8.5.1-alternate-constructor-invocation-1
An alternate constructor invocation invokes a constructor of the same class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-alternate-constructor-invocation-1 {
        An alternate constructor invocation invokes a
        constructor of the same class } {
    
    empty_class T8851aci1 {
T8851aci1() { this(0); }
T8851aci1(int i) {}
     }

} {PASS}
Test Case: 8.8.5.1-alternate-constructor-invocation-2
An alternate constructor invocation can invoke a chain of constructors in the same class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.5.1-alternate-constructor-invocation-2 {
        An alternate constructor invocation can invoke
        a chain of constructors in the same class } {
    
    empty_class T8851aci2 {
T8851aci2() { this(0); }
T8851aci2(int i) { this("noggy"); }
T8851aci2(String s) { this(true); }
T8851aci2(boolean state) { }
     }

} {PASS}
Test Case: 8.8.5.1-alternate-constructor-invocation-3
An alternate constructor must exist

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.5.1-alternate-constructor-invocation-3 {
        An alternate constructor must exist } {
    
    empty_class T8851aci3 {
T8851aci3(int i) { this(); }
     }

} {FAIL}

8.8.6

Directory : tests/jls/classes/constructor-declarations/constructor-overloading


Test Case: 8.8.6-overloaded-1
An overloaded constructor is resolved at compiler time as described in 15.9.3

Expected Result: PASS

Regression Test:

tcltest::test 8.8.6-overloaded-1 { An overloaded constructor
        is resolved at compiler time as described in 15.9.3 } {
    
    empty_class T886o1 {
T886o1(Object o) {}
T886o1(String s) {}
void foo() {
    Object obj = new T886o1("");
}
    }

} {PASS}

8.8.7

Directory : tests/jls/classes/constructor-declarations/default-constructor


Test Case: 8.8.7-default-1
If a class contains no constructor declarations, then a default constructor that takes no parameters is automatically provided

Expected Result: PASS

Regression Test:

tcltest::test 8.8.7-default-1 { If a class
        contains no constructor declarations,
        then a default constructor that takes
        no parameters is automatically provided } {
    
    empty_class T887d1 {
Object o = new T887d1();
    }

} {PASS}
Test Case: 8.8.7-default-2
If a class contains no constructor declarations, then a default constructor that takes no parameters is automatically provided

Expected Result: PASS

Regression Test:

tcltest::test 8.8.7-default-2 { If a class
        contains no constructor declarations,
        then a default constructor that takes
        no parameters is automatically provided } {
    
    saveas T887d2.java {
class T887d2_super {}
class T887d2_subclass extends T887d2_super {}
class T887d2 {
    Object o = new T887d2_subclass();
}
    }

    compile T887d2.java

} {PASS}
Test Case: 8.8.7-throws-1
A default constructor has no throws clause

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.7-throws-1 { A default
        constructor has no throws clause } {
    
    saveas T887t1.java {
class T887t1_super {
    T887t1_super() throws Exception {
        throw new Exception();
    }
}
class T887t1_subclass extends T887t1_super {}
    }

    compile T887t1.java

} {FAIL}
Test Case: 8.8.7-inaccessible-default-constructor-toplevel-1
A private constructor is not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.7-inaccessible-default-constructor-toplevel-1 {
        A private constructor is not accessible in a subclass } {
    
    saveas T887idct1.java {
class T887idct1_super {
    private T887idct1_super() {}
}

class T887idct1_subclass extends T887idct1_super {}
    }

    compile T887idct1.java

} {FAIL}
Test Case: 8.8.7-inaccessible-default-constructor-toplevel-2
A constructor with default accessibility in some other package is not accessible in a subclass

Expected Result: FAIL

Regression Test:

tcltest::test 8.8.7-inaccessible-default-constructor-toplevel-2 {
        A constructor with default accessibility in some other
        package is not accessible in a subclass } {
    

    saveas T887idct2_super.java {
package T887idct2_pkg;
public class T887idct2_super {
    T887idct2_super() {}
}
    }

    saveas T887idct2.java {
import T887idct2_pkg.T887idct2_super;
class T887idct2_subclass extends T887idct2_super {}
    }

    compile T887idct2_super.java T887idct2.java

} {FAIL}
Test Case: 8.8.7-accessible-default-constructor-inner-1
A constructor with private accessibility can be accessed from an inner class defined inside the same class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.7-accessible-default-constructor-inner-1 {
        A constructor with private accessibility can be accessed
        from an inner class defined inside the same class } {
    

    empty_class T887adci1 {
private T887adci1() {}
static class T887adci1_inner extends T887adci1 {}
    }

} {PASS}
Test Case: 8.8.7-accessible-default-constructor-inner-2
A constructor with private accessibility can be accessed from an inner class defined inside the same class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.7-accessible-default-constructor-inner-2 {
        A constructor with private accessibility can be accessed
        from an inner class defined inside the same class } {
    

    empty_class T887adci2 {
private T887adci2() {}
class T887adci2_inner extends T887adci2 {}
    }

} {PASS}
Test Case: 8.8.7-accessible-default-constructor-inner-3
A constructor with private accessibility can be accessed from an inner class defined inside the same class

Expected Result: PASS

Regression Test:

tcltest::test 8.8.7-accessible-default-constructor-inner-3 {
        A constructor with private accessibility can be accessed
        from an inner class defined inside the same class } {
    

    empty_class T887adci3 {
private T887adci3() {}
Object o = new T887adci3() {
    void f() {}
};
}

} {PASS}

9.1.1

Directory : tests/jls/interfaces/interface-declarations/interface-modifiers


Test Case: 9.1.1-1
should generate error on synchronized interface

Expected Result: FAIL

Regression Test:

tcltest::test 9.1.1-1 {should generate error on synchronized interface} {
    
    compile [saveas SynchronizedInterface.java  "synchronized interface SynchronizedInterface {}"]

} {FAIL}
Test Case: 9.1.1-2
adding the public keyword to an interface declared as public triggers a bug in the javac shipped with jdk 1.1

Expected Result: FAIL

Regression Test:

tcltest::test 9.1.1-2 {adding the public keyword to an interface declared
        as public triggers a bug in the javac shipped with jdk 1.1} {
    
    compile [saveas PublicSynchronizedInterface.java  "public synchronized interface PublicSynchronizedInterface {}"]

} {FAIL}
Test Case: 9.1.1-3
the modifier public can be redundantly specified

Expected Result: PASS

Regression Test:

tcltest::test 9.1.1-3 {the modifier public can be redundantly specified} {
    
    compile [saveas PublicInterface.java  "public interface PublicInterface {}"]

} {PASS}
Test Case: 9.1.1-4
should generate an error if a modifier is given more than once

Expected Result: FAIL

Regression Test:

tcltest::test 9.1.1-4 {should generate an error if a modifier is given more than once} {
    
    compile [saveas PublicPublicInterface.java  "public public interface PublicPublicInterface {}"]

} {FAIL}
Test Case: 9.1.1-5
The access modifier protected pertains only to member interfaces

Expected Result: FAIL

Regression Test:

tcltest::test 9.1.1-5 {The access modifier protected pertains only to member interfaces} {
    
    compile [saveas ProtectedInterface.java  "protected interface ProtectedInterface {}"]

} {FAIL}
Test Case: 9.1.1-6
The access modifier private pertains only to member interfaces

Expected Result: FAIL

Regression Test:

tcltest::test 9.1.1-6 {The access modifier private pertains only to member interfaces} {
    
    compile [saveas PrivateInterface.java  "private interface PrivateInterface {}"]

} {FAIL}
Test Case: 9.1.1-7
The access modifier static pertains only to member interfaces

Expected Result: FAIL

Regression Test:

tcltest::test 9.1.1-7 {The access modifier static pertains only to member interfaces} {
    
    compile [saveas StaticInterface.java  "static interface StaticInterface {}"]

} {FAIL}

9.1.1.1

Directory : tests/jls/interfaces/interface-declarations/interface-modifiers/abstract-interfaces


Test Case: 9.1.1.1-1
The compiler may generate a warning when abstract modifier is applied to an implicitly abstract interface

Expected Result: OK

Regression Test:

tcltest::test 9.1.1.1-1 { The compiler may generate a warning when
        abstract modifier is applied to an implicitly abstract interface } {
    
    saveas AbstractInterface.java "abstract interface AbstractInterface {}"
    ok_pass_or_warn [compile AbstractInterface.java]

} {OK}
Test Case: 9.1.1.1-2
The compiler may generate a warning when abstract modifier is applied to an implicitly abstract inner interface

Expected Result: OK

Regression Test:

tcltest::test 9.1.1.1-2 { The compiler may generate a warning when
        abstract modifier is applied to an implicitly abstract inner interface } {
    
    saveas AbstractInnerInterface.java  {
public class AbstractInnerInterface {
    abstract interface Inter {}
}
}
    ok_pass_or_warn [compile AbstractInnerInterface.java]

} {OK}
Test Case: 9.1.1.1-3
The compiler may generate a warning when abstract modifier is applied to an implicitly abstract inner interface that is defined inside another interface

Expected Result: OK

Regression Test:

tcltest::test 9.1.1.1-3 { The compiler may generate a warning when
        abstract modifier is applied to an implicitly abstract inner interface
        that is defined inside another interface } {
    
    saveas AbstractInnerInterface_InInnerface.java  {
public interface AbstractInnerInterface_InInnerface {
    abstract interface Inter {}
}
}
    ok_pass_or_warn [compile AbstractInnerInterface_InInnerface.java]

} {OK}

10.6

Directory : tests/jls/arrays/array-initializers


Test Case: 10.6-syntax-1
array initializer may be empty

Expected Result: PASS

Regression Test:

tcltest::test 10.6-syntax-1 { array initializer may be empty } {
    
    empty_main T106s1 {
        int[] ia = {};
    }

} {PASS}
Test Case: 10.6-syntax-2
array initializer may contain initializers

Expected Result: PASS

Regression Test:

tcltest::test 10.6-syntax-2 { array initializer may contain initializers } {
    
    empty_main T106s2 {
        int[] ia = { 1 };
    }

} {PASS}
Test Case: 10.6-syntax-3
array initializer may contain initializers

Expected Result: PASS

Regression Test:

tcltest::test 10.6-syntax-3 { array initializer may contain initializers } {
    
    empty_main T106s3 {
        int[] ia = { 1, 2 };
    }

} {PASS}
Test Case: 10.6-syntax-4
array initializer may contain concluding comma

Expected Result: PASS

Regression Test:

tcltest::test 10.6-syntax-4 { array initializer may contain concluding comma } {
    
    empty_main T106s4 {
        int[] ia = { , };
    }

} {PASS}
Test Case: 10.6-syntax-5
array initializer may contain concluding comma

Expected Result: PASS

Regression Test:

tcltest::test 10.6-syntax-5 { array initializer may contain concluding comma } {
    
    empty_main T106s5 {
        int[] ia = { 1, };
    }

} {PASS}
Test Case: 10.6-syntax-6
array initializers may nest

Expected Result: PASS

Regression Test:

tcltest::test 10.6-syntax-6 { array initializers may nest } {
    
    empty_main T106i6 {
        int[][] iaa = { {1}, {2} };
    }

} {PASS}
Test Case: 10.6-type-1
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 10.6-type-1 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t1 {
        short s = 1;
        int[] ia = { s, '1' };
    }

} {PASS}
Test Case: 10.6-type-2
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-2 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t2 {
        int[] ia = { 1L };
    }

} {FAIL}
Test Case: 10.6-type-3
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-3 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t3 {
        int[] ia = { new Object() };
    }

} {FAIL}
Test Case: 10.6-type-4
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-4 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t4 {
        int[] ia = { null };
    }

} {FAIL}
Test Case: 10.6-type-5
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-5 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t5 {
        int[] ia = { System.out.println() };
    }

} {FAIL}
Test Case: 10.6-type-6
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-6 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t6 {
        Object[] oa = { 1 };
    }

} {FAIL}
Test Case: 10.6-type-7
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 10.6-type-7 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t7 {
        Object[] oa = { new Object() };
    }

} {PASS}
Test Case: 10.6-type-8
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 10.6-type-8 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t8 {
        Object[] oa = { null };
    }

} {PASS}
Test Case: 10.6-type-9
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-9 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t9 {
        Object[] oa = { System.out.println() };
    }

} {FAIL}
Test Case: 10.6-type-10
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 10.6-type-10 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t10 {
        int[][] iaa = { {1} };
    }

} {PASS}
Test Case: 10.6-type-11
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-11 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t11 {
        int[][] iaa = { 1 };
    }

} {FAIL}
Test Case: 10.6-type-12
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 10.6-type-12 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t12 {
        int[][] iaa = { { {1} } };
    }

} {FAIL}
Test Case: 10.6-type-13
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 10.6-type-13 { expressions in array initializer must be
        assignment compatible with array type } {
    
    empty_main T106t13 {
        int[][] iaa = { {1, 2}, null };
    }

} {PASS}

14.7

Directory : tests/jls/blocks-and-statements/labeled-statements


Test Case: 14.7-scope-1
The scope of a label is its contained statement

Expected Result: PASS

Regression Test:

tcltest::test 14.7-scope-1 { The scope of a label is its contained statement } {
    
    empty_main T147scope1 {
        int i, j;
        label: i = 1;
        label: j = 1;
    }

} {PASS}
Test Case: 14.7-shadow-1
Labels cannot shadow another label in the same enclosing method, constructor, or initializer

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-shadow-1 { Labels cannot shadow another label in the
        same enclosing method, constructor, or initializer } {
    
    empty_main T147shadow1 {
        int i;
        test: {
            test: i = 1;
        }
    }

} {FAIL}
Test Case: 14.7-shadow-2
Labels cannot shadow another label in the same enclosing method, constructor, or initializer

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-shadow-2 { Labels cannot shadow another label in the
        same enclosing method, constructor, or initializer } {
    
    empty_main T147shadow2 {
        int i;
        test: test: i = 1;
    }

} {FAIL}
Test Case: 14.7-shadow-3
Labels cannot shadow another label in the same immediately enclosing method, constructor, or initializer. Here, the two labels are in different immediately enclosing methods.

Expected Result: PASS

Regression Test:

tcltest::test 14.7-shadow-3 { Labels cannot shadow another label in the same
        immediately enclosing method, constructor, or initializer. Here, the
        two labels are in different immediately enclosing methods.} {
    
    empty_main T147shadow3 {
        test: new Object() {
            void foo() {
                int i;
                test: i = 1;
            }
        };
    }

} {PASS}
Test Case: 14.7-same-1
Labels can share same identifier as package

Expected Result: PASS

Regression Test:

tcltest::test 14.7-same-1 { Labels can share same identifier as package } {
    
    compile [saveas test/T147same1.java {
package test;
class T147same1 {
    void foo() {
        int i;
        test: i = 1;
        new test.T147same1();
    }
}
    }]

} {PASS}
Test Case: 14.7-same-2
Labels can share same identifier as class

Expected Result: PASS

Regression Test:

tcltest::test 14.7-same-2 { Labels can share same identifier as class } {
    
    empty_main T147same2 {
        int i;
        T147same2: i = 1;
        new T147same2();
    }

} {PASS}
Test Case: 14.7-same-3
Labels can share same identifier as interface

Expected Result: PASS

Regression Test:

tcltest::test 14.7-same-3 { Labels can share same identifier as interface } {
    
    empty_main T147same3 {
        int i;
        Cloneable: i = 1;
        new Cloneable() {};
    }

} {PASS}
Test Case: 14.7-same-4
Labels can share same identifier as method

Expected Result: PASS

Regression Test:

tcltest::test 14.7-same-4 { Labels can share same identifier as method } {
    
    empty_class T147same4 {
        void test() {}
        void foo() {
            int i;
            test: i = 1;
            test();
        }
    }

} {PASS}
Test Case: 14.7-same-5
Labels can share same identifier as field

Expected Result: PASS

Regression Test:

tcltest::test 14.7-same-5 { Labels can share same identifier as field } {
    
    empty_class T147same5 {
        int test;
        void foo() {
            int i;
            test: i = 1;
            test = 1;
        }
    }

} {PASS}
Test Case: 14.7-same-6
Labels can share same identifier as parameter

Expected Result: PASS

Regression Test:

tcltest::test 14.7-same-6 { Labels can share same identifier as parameter } {
    
    empty_class T147same6 {
        void foo(String[] args) {
            int i;
            args: i = 1;
            i = args.length;
        }
    }

} {PASS}
Test Case: 14.7-same-7
Labels can share same identifier as local variable

Expected Result: PASS

Regression Test:

tcltest::test 14.7-same-7 { Labels can share same identifier as
        local variable } {
    
    empty_main T147same7 {
        int test, i;
        test: i = 1;
        test = 1;
    }

} {PASS}
Test Case: 14.7-enclosed-1
Labels must have an enclosed statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-enclosed-1 { Labels must have an enclosed statement } {
    
    empty_main T147enclosed1 {
        test:
    }

} {FAIL}
Test Case: 14.7-enclosed-2
Labels must have an enclosed statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-enclosed-2 { Labels must have an enclosed statement } {
    
    empty_main T147enclosed2 {
        test: int i;
    }

} {FAIL}
Test Case: 14.7-enclosed-3
Labels must have an enclosed statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-enclosed-3 { Labels must have an enclosed statement } {
    
    empty_main T147enclosed3 {
        test: class foo() {}
    }

} {FAIL}
Test Case: 14.7-enclosed-4
Labels must have an enclosed statement

Expected Result: PASS

Regression Test:

tcltest::test 14.7-enclosed-4 { Labels must have an enclosed statement } {
    
    empty_main T147enclosed4 {
        test: {}
    }

} {PASS}
Test Case: 14.7-enclosed-5
Labels must have an enclosed statement

Expected Result: PASS

Regression Test:

tcltest::test 14.7-enclosed-5 { Labels must have an enclosed statement } {
    
    empty_main T147enclosed5 {
        test: ;
    }

} {PASS}
Test Case: 14.7-ident-1
Labels must be identifiers

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-ident-1 { Labels must be identifiers } {
    
    empty_main T147ident1 {
        int i;
        1: i = 1;
    }

} {FAIL}
Test Case: 14.7-ident-2
Labels must be identifiers

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-ident-2 { Labels must be identifiers } {
    
    empty_main T147ident2 {
        int i;
        "label": i = 1;
    }

} {FAIL}
Test Case: 14.7-ident-3
Labels must be identifiers

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-ident-3 { Labels must be identifiers } {
    
    empty_main T147ident3 {
        int i;
        (label): i = 1;
    }

} {FAIL}
Test Case: 14.7-ident-4
Labels must be identifiers

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-ident-4 { Labels must be identifiers } {
    
    empty_main T147ident4 {
        int i;
        label.a: i = 1;
    }

} {FAIL}
Test Case: 14.7-ident-5
Labels must be identifiers

Expected Result: FAIL

Regression Test:

tcltest::test 14.7-ident-5 { Labels must be identifiers } {
    
    empty_main T147ident5 {
        int i;
        int: i = 1;
    }

} {FAIL}
Test Case: 14.7-ident-6
Labels must be identifiers, including unicode

Expected Result: PASS

Regression Test:

tcltest::test 14.7-ident-6 { Labels must be identifiers, including unicode } {
    
    empty_main T147ident6 {
        int i;
        \u0061\u003a break a;
        b: break \u0062;
    }

} {PASS}

14.10

Directory : tests/jls/blocks-and-statements/switch-statement


Test Case: 14.10-invalid-syntax-1
SwitchStatement must have () around Expression

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-syntax-1 { SwitchStatement must have () around Expression } {
    
    compile [saveas T1410is1.java {
class T1410is1 {
    void foo(int i) {
        switch i {
            default:
        }
    }
}
    }]

} {FAIL}
Test Case: 14.10-invalid-syntax-2
SwitchBlock must have {} around statements

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-syntax-2 { SwitchBlock must have {} around statements } {
    
    compile [saveas T1410is2.java {
class T1410is2 {
    void foo(int i) {
        switch (i)
            default:
    }
}
    }]

} {FAIL}
Test Case: 14.10-invalid-syntax-3
SwitchBlockStatementGroup must begin with a SwitchLabel

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-syntax-3 { SwitchBlockStatementGroup must begin with
         a SwitchLabel} {
    
    compile [saveas T1410is3.java {
class T1410is3 {
    void foo(int i) {
        switch (i) {
            i = 0;
        }
    }
}
    }]

} {FAIL}
Test Case: 14.10-invalid-syntax-4
Duff's device is not valid

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-syntax-4 { Duff's device is not valid } {
    
    compile [saveas T1410is4.java {
class T1410is4 {
    void foo(int n) {
        int q = (n+7)/8;
        switch (n%8) {
            case 0:         do {    foo();          // Great C hack, Tom,
            case 7:                 foo();          // but it's not valid here.
            case 6:                 foo();
            case 5:                 foo();
            case 4:                 foo();
            case 3:                 foo();
            case 2:                 foo();
            case 1:                 foo();
                            } while (--q >= 0);
        }
    }
}
    }]

} {FAIL}
Test Case: 14.10-valid-1
SwitchBlockStatementGroups and SwitchLabels are optional inside a SwitchBlock

Expected Result: PASS

Regression Test:

tcltest::test 14.10-valid-1 { SwitchBlockStatementGroups and SwitchLabels are
        optional inside a SwitchBlock } {
    
    switch_labels T1410v1 int {}

} {PASS}
Test Case: 14.10-valid-2
default SwitchLabel by itself is acceptable

Expected Result: PASS

Regression Test:

tcltest::test 14.10-valid-2 { default SwitchLabel by itself is acceptable } {
    
    switch_labels T1410v2 int {default:}

} {PASS}
Test Case: 14.10-invalid-type-1
Expression type must be char, byte, short, or int

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-type-1 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410it1 boolean

} {FAIL}
Test Case: 14.10-invalid-type-2
Expression type must be char, byte, short, or int

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-type-2 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410it2 float

} {FAIL}
Test Case: 14.10-invalid-type-3
Expression type must be char, byte, short, or int

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-type-3 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410it3 double

} {FAIL}
Test Case: 14.10-invalid-type-4
Expression type must be char, byte, short, or int

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-type-4 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410it4 long

} {FAIL}
Test Case: 14.10-invalid-type-5
Expression type must be char, byte, short, or int

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-type-5 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410it5 Object

} {FAIL}
Test Case: 14.10-invalid-type-6
Expression type must be char, byte, short, or int

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-invalid-type-6 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410it6 String

} {FAIL}
Test Case: 14.10-valid-type-1
Expression type must be char, byte, short, or int

Expected Result: PASS

Regression Test:

tcltest::test 14.10-valid-type-1 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410vt1 char

} {PASS}
Test Case: 14.10-valid-type-2
Expression type must be char, byte, short, or int

Expected Result: PASS

Regression Test:

tcltest::test 14.10-valid-type-2 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410vt2 byte

} {PASS}
Test Case: 14.10-valid-type-3
Expression type must be char, byte, short, or int

Expected Result: PASS

Regression Test:

tcltest::test 14.10-valid-type-3 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410vt3 short

} {PASS}
Test Case: 14.10-valid-type-4
Expression type must be char, byte, short, or int

Expected Result: PASS

Regression Test:

tcltest::test 14.10-valid-type-4 { Expression type must be char, byte, short, or int } {
    
    switch_labels T1410vt4 int

} {PASS}
Test Case: 14.10-switchlabel-1
case label must have a ConstantExpression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-switchlabel-1 { case label must have a ConstantExpression } {
    
    switch_labels T1410sl1 int {case 0: case 1:}

} {PASS}
Test Case: 14.10-switchlabel-2
case label must have a ConstantExpression, i++ is not a constant expression as defined by 15.28

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-switchlabel-2 { case label must have a ConstantExpression,
        i++ is not a constant expression as defined by 15.28} {
    
    switch_labels T1410sl2 int {case (i++):}

} {FAIL}
Test Case: 14.10-switchlabel-3
case label must have a ConstantExpression, i++ is not a constant expression as defined by 15.28

Expected Result: PASS

Regression Test:

tcltest::test 14.10-switchlabel-3 { case label must have a ConstantExpression,
        i++ is not a constant expression as defined by 15.28} {
    
    switch_labels T1410sl3 int {case 0: case (2-1): case (3-1): default:}

} {PASS}
Test Case: 14.10-assignable-1
ConstantExpression must be assignable to Expression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-assignable-1 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a1 int {case 0:}

} {PASS}
Test Case: 14.10-assignable-2
ConstantExpression must be assignable to Expression

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-assignable-2 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a2 int {case 0L:}

} {FAIL}
Test Case: 14.10-assignable-3
ConstantExpression must be assignable to Expression

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-assignable-3 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a3 int {case 0.0D:}

} {FAIL}
Test Case: 14.10-assignable-4
ConstantExpression must be assignable to Expression

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-assignable-4 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a4 int {case true:}

} {FAIL}
Test Case: 14.10-assignable-5
ConstantExpression must be assignable to Expression

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-assignable-5 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a5 byte {case 128:}

} {FAIL}
Test Case: 14.10-assignable-6
ConstantExpression must be assignable to Expression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-assignable-6 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a6 byte {case 127:}

} {PASS}
Test Case: 14.10-assignable-7
ConstantExpression must be assignable to Expression

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-assignable-7 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a7 int {case null:}

} {FAIL}
Test Case: 14.10-assignable-8
ConstantExpression must be assignable to Expression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-assignable-8 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a8 byte {case (short) 1:}

} {PASS}
Test Case: 14.10-assignable-9
ConstantExpression must be assignable to Expression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-assignable-9 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a9 byte {case '1':}

} {PASS}
Test Case: 14.10-assignable-10
ConstantExpression must be assignable to Expression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-assignable-10 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a10 char {case (short) 1:}

} {PASS}
Test Case: 14.10-assignable-11
ConstantExpression must be assignable to Expression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-assignable-11 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a11 short {case '1':}

} {PASS}
Test Case: 14.10-assignable-12
ConstantExpression must be assignable to Expression

Expected Result: PASS

Regression Test:

tcltest::test 14.10-assignable-12 { ConstantExpression must be assignable to Expression } {
    
    switch_labels T1410a12 char {case (byte) 1:}

} {PASS}
Test Case: 14.10-duplicate-1
No two case statements may have the same ConstantExpression value

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-duplicate-1 { No two case statements may have the same
        ConstantExpression value } {
    
    switch_labels T1410d1 int {case 0: case 1: case 0:}

} {FAIL}
Test Case: 14.10-duplicate-2
No two case statements may have the same ConstantExpression value

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-duplicate-2 { No two case statements may have the same
        ConstantExpression value } {
    
    switch_labels T1410d2 int {case 0: case 1: case (2-2):}

} {FAIL}
Test Case: 14.10-duplicate-3
No two case statements may have the same ConstantExpression value

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-duplicate-3 { No two case statements may have the same
        ConstantExpression value } {
    
    switch_labels T1410d3 int {case 0: case 1: case ((2==2) ? 0 : 2):}

} {FAIL}
Test Case: 14.10-duplicate-4
At most 1 default statement can be associated with the same switch statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-duplicate-4 { At most 1 default statement can be associated
        with the same switch statement } {
    
    switch_labels T1410d4 int {default: case 0: default:}

} {FAIL}
Test Case: 14.10-abrupt-completion-1
break is a valid abrupt completion

Expected Result: PASS

Regression Test:

tcltest::test 14.10-abrupt-completion-1 { break is a valid abrupt completion } {
    
    switch_labels T1410ac1 int {case 0:
                                  break;}  {case 1:
                                  break;}

} {PASS}
Test Case: 14.10-abrupt-completion-2
continue is not a valid abrupt completion

Expected Result: FAIL

Regression Test:

tcltest::test 14.10-abrupt-completion-2 { continue is not a valid abrupt completion } {
    
    switch_labels T1410ac2 int {case 0:
                                  break;}  {case 1:
                                  continue;}

} {FAIL}
Test Case: 14.10-exhaustion-1
When all 256 cases explicitly listed, the specs are unclear as to whether default is reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.10-exhaustion-1 { When all 256 cases explicitly listed, the
        specs are unclear as to whether default is reachable } {
    
    switch_labels T1410e1 byte [exhaust_list] "break; default:"

} {PASS}
Test Case: 14.10-exhaustion-2
When all 256 cases explicitly listed, the specs are unclear as to whether the switch can complete normally

Expected Result: PASS

Regression Test:

tcltest::test 14.10-exhaustion-2 { When all 256 cases explicitly listed, the
        specs are unclear as to whether the switch can complete normally } {
    
    switch_labels T1410e2 byte [exhaust_list]  "throw new RuntimeException();\n        \}\n        \{System.out.println();"

} {PASS}

14.14

Directory : tests/jls/blocks-and-statements/break-statement


Test Case: 14.14-plain-1
plain break must occur in a loop statement or switch

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-plain-1 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p1 {
        break;
    }

} {FAIL}
Test Case: 14.14-plain-2
plain break must occur in a loop statement or switch

Expected Result: PASS

Regression Test:

tcltest::test 14.14-plain-2 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p2 {
        for (int i=0; i<10; i++)
            break;
    }

} {PASS}
Test Case: 14.14-plain-3
plain break must occur in a loop statement or switch

Expected Result: PASS

Regression Test:

tcltest::test 14.14-plain-3 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p3 {
        int i=0;
        while (i++<10)
            break;
    }

} {PASS}
Test Case: 14.14-plain-4
plain break must occur in a loop statement or switch

Expected Result: PASS

Regression Test:

tcltest::test 14.14-plain-4 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p4 {
        int i=0;
        do break;
        while (i++<10);
    }

} {PASS}
Test Case: 14.14-plain-5
plain break must occur in a loop statement or switch

Expected Result: PASS

Regression Test:

tcltest::test 14.14-plain-5 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p5 {
        for (int i=0; i<10; i++) {
            break;
        }
    }

} {PASS}
Test Case: 14.14-plain-6
plain break must occur in a loop statement or switch

Expected Result: PASS

Regression Test:

tcltest::test 14.14-plain-6 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p6 {
        int i=0;
        while (i++<10) {
            break;
        }
    }

} {PASS}
Test Case: 14.14-plain-7
plain break must occur in a loop statement or switch

Expected Result: PASS

Regression Test:

tcltest::test 14.14-plain-7 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p7 {
        int i=0;
        do {
            break;
        } while (i++<10);
    }

} {PASS}
Test Case: 14.14-plain-8
plain break must occur in a loop statement or switch

Expected Result: PASS

Regression Test:

tcltest::test 14.14-plain-8 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p8 {
        switch (args.length) {
            case 0: break;
        }
    }

} {PASS}
Test Case: 14.14-plain-9
plain break must occur in a loop statement or switch

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-plain-9 { plain break must occur in a loop
        statement or switch } {
    
    empty_main T1414p9 {
        a: break;
    }

} {FAIL}
Test Case: 14.14-nonlocal-1
there are no non-local jumps

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-nonlocal-1 { there are no non-local jumps } {
    
    empty_main T1414nonlocal1 {
        do {
            new Object() {
                {
                    break;
                }
            };
        } while (false);
    }

} {FAIL}
Test Case: 14.14-try-1
the break can be interrupted by a finally

Expected Result: PASS

Regression Test:

tcltest::test 14.14-try-1 { the break can be interrupted by
        a finally } {
    
    empty_main T1414try1 {
        do {
            try {
                try {
                    break;
                } finally { // discard the break
                    throw new Exception();
                }
            } catch (Throwable t) { // stop the exception
            }
            int i = 1; // reachable, even though it follows a break
        } while (false);
    }

} {PASS}
Test Case: 14.14-label-1
A label may be targeted by break

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-1 { A label may be
        targeted by break } {
    
    empty_main T1414l1 {
        a: {
            for (int i=0; i<10; i++)
                break a;
        }
    }

} {PASS}
Test Case: 14.14-label-2
A label may be targeted by break

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-2 { A label may be
        targeted by break } {
    
    empty_main T1414l2 {
        a: b: for (int i=0; i<10; i++)
            break a;
    }

} {PASS}
Test Case: 14.14-label-3
labeled break must occur in that label

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-label-3 { labeled break must
        occur in that label } {
    
    empty_main T1414l3 {
        b: break a;
    }

} {FAIL}
Test Case: 14.14-label-4
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-4 { labeled break must
        occur in that label } {
    
    empty_main T1414l4 {
        a: break a;
    }

} {PASS}
Test Case: 14.14-label-5
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-5 { labeled break must
        occur in that label } {
    
    empty_main T1414l5 {
        a: for (int i=0; i<10; i++)
            break a;
    }

} {PASS}
Test Case: 14.14-label-6
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-6 { labeled break must
        occur in that label } {
    
    empty_main T1414l6 {
        int i=0;
        a: while (i++<10)
            break a;
    }

} {PASS}
Test Case: 14.14-label-7
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-7 { labeled break must
        occur in that label } {
    
    empty_main T1414l7 {
        int i=0;
        a: do break a;
        while (i++<10);
    }

} {PASS}
Test Case: 14.14-label-8
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-8 { labeled break must
        occur in that label } {
    
    empty_main T1414l8 {
        a: for (int i=0; i<10; i++) {
            break a;
        }
    }

} {PASS}
Test Case: 14.14-label-9
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-9 { labeled break must
        occur in that label } {
    
    empty_main T1414l9 {
        int i=0;
        a: while (i++<10) {
            break a;
        }
    }

} {PASS}
Test Case: 14.14-label-10
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-10 { labeled break must
        occur in that label } {
    
    empty_main T1414l10 {
        int i=0;
        a: do {
            break a;
        } while (i++<10);
    }

} {PASS}
Test Case: 14.14-label-11
labeled break must occur in that label

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-11 { labeled break must
        occur in that label } {
    
    empty_main T1414l11 {
        a: switch (args.length) {
            case 0: break a;
        }
    }

} {PASS}
Test Case: 14.14-label-12
there are no non-local jumps

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-label-12 { there are no
        non-local jumps } {
    
    empty_main T1414l12 {
        a: do {
            new Object() {
                {
                    break a;
                }
            };
        } while (false);
    }

} {FAIL}
Test Case: 14.14-label-13
the break can be interrupted by a finally

Expected Result: PASS

Regression Test:

tcltest::test 14.14-label-13 { the break can be
        interrupted by a finally } {
    
    empty_main T1414l13 {
        a: do {
            try {
                try {
                    break a;
                } finally { // discard the break
                    throw new Exception();
                }
            } catch (Throwable t) { // stop the exception
            }
            int i = 1; // reachable, even though it follows a break
        } while (false);
    }

} {PASS}
Test Case: 14.14-arg-1
The arg to break must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-arg-1 { The arg to break
        must be an identifier } {
    
    empty_main T1414a1 {
        a: do {
            break 1;
        } while (false);
    }

} {FAIL}
Test Case: 14.14-arg-2
The arg to break must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-arg-2 { The arg to break
        must be an identifier } {
    
    empty_main T1414a2 {
        a: do {
            break "a";
        } while (false);
    }

} {FAIL}
Test Case: 14.14-arg-3
The arg to break must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-arg-3 { The arg to break
        must be an identifier } {
    
    empty_main T1414a3 {
        a: do {
            break (a);
        } while (false);
    }

} {FAIL}
Test Case: 14.14-arg-4
The arg to break must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.14-arg-4 { The arg to break
        must be an identifier } {
    
    empty_main T1414a4 {
        a: do {
            break a.a;
        } while (false);
    }

} {FAIL}

14.15

Directory : tests/jls/blocks-and-statements/continue-statement


Test Case: 14.15-plain-1
continue must occur in a loop statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-plain-1 { continue must occur in a loop statement } {
    
    empty_main T1415p1 {
        continue;
    }

} {FAIL}
Test Case: 14.15-plain-2
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-plain-2 { continue must occur in a loop statement } {
    
    empty_main T1415p2 {
        for (int i=0; i<10; i++)
            continue;
    }

} {PASS}
Test Case: 14.15-plain-3
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-plain-3 { continue must occur in a loop statement } {
    
    empty_main T1415p3 {
        int i=0;
        while (i++<10)
            continue;
    }

} {PASS}
Test Case: 14.15-plain-4
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-plain-4 { continue must occur in a loop statement } {
    
    empty_main T1415p4 {
        int i=0;
        do continue;
        while (i++<10);
    }

} {PASS}
Test Case: 14.15-plain-5
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-plain-5 { continue must occur in a loop statement } {
    
    empty_main T1415p5 {
        for (int i=0; i<10; i++) {
            continue;
        }
    }

} {PASS}
Test Case: 14.15-plain-6
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-plain-6 { continue must occur in a loop statement } {
    
    empty_main T1415p6 {
        int i=0;
        while (i++<10) {
            continue;
        }
    }

} {PASS}
Test Case: 14.15-plain-7
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-plain-7 { continue must occur in a loop statement } {
    
    empty_main T1415p7 {
        int i=0;
        do {
            continue;
        } while (i++<10);
    }

} {PASS}
Test Case: 14.15-plain-8
continue must occur in a loop statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-plain-8 { continue must occur in a loop statement } {
    
    empty_main T1415p8 {
        switch (args.length) {
            case 0: continue;
        }
    }

} {FAIL}
Test Case: 14.15-nonlocal-1
there are no non-local jumps

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-nonlocal-1 { there are no non-local jumps } {
    
    empty_main T1415nonlocal1 {
        do {
            new Object() {
                {
                    continue;
                }
            };
        } while (false);
    }

} {FAIL}
Test Case: 14.15-try-1
the continue can be interrupted by a finally

Expected Result: PASS

Regression Test:

tcltest::test 14.15-try-1 { the continue can be interrupted by a finally } {
    
    empty_main T1415try1 {
        do {
            try {
                try {
                    continue;
                } finally { // discard the continue
                    throw new Exception();
                }
            } catch (Throwable t) { // stop the exception
            }
            int i = 1; // reachable, even though it follows a continue
        } while (false);
    }

} {PASS}
Test Case: 14.15-label-1
A label targeted by continue must have a loop as its statment

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-label-1 { A label targeted by continue
        must have a loop as its statment } {
    
    empty_main T1415l1 {
        a: {
            for (int i=0; i<10; i++)
                continue a;
        }
    }

} {FAIL}
Test Case: 14.15-label-2
A label targeted by continue must have a loop as its statment

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-label-2 { A label targeted by continue
        must have a loop as its statment } {
    
    empty_main T1415l2 {
        a: b: for (int i=0; i<10; i++)
            continue a;
    }

} {FAIL}
Test Case: 14.15-label-3
labeled continue must occur in that label

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-label-3 { labeled continue must occur in that label } {
    
    empty_main T1415l3 {
        b: continue a;
    }

} {FAIL}
Test Case: 14.15-label-4
continue must occur in a loop statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-label-4 { continue must occur in a loop statement } {
    
    empty_main T1415l4 {
        a: continue a;
    }

} {FAIL}
Test Case: 14.15-label-5
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-label-5 { continue must occur in a loop statement } {
    
    empty_main T1415l5 {
        a: for (int i=0; i<10; i++)
            continue a;
    }

} {PASS}
Test Case: 14.15-label-6
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-label-6 { continue must occur in a loop statement } {
    
    empty_main T1415l6 {
        int i=0;
        a: while (i++<10)
            continue a;
    }

} {PASS}
Test Case: 14.15-label-7
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-label-7 { continue must occur in a loop statement } {
    
    empty_main T1415l7 {
        int i=0;
        a: do continue a;
        while (i++<10);
    }

} {PASS}
Test Case: 14.15-label-8
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-label-8 { continue must occur in a loop statement } {
    
    empty_main T1415l8 {
        a: for (int i=0; i<10; i++) {
            continue a;
        }
    }

} {PASS}
Test Case: 14.15-label-9
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-label-9 { continue must occur in a loop statement } {
    
    empty_main T1415l9 {
        int i=0;
        a: while (i++<10) {
            continue a;
        }
    }

} {PASS}
Test Case: 14.15-label-10
continue must occur in a loop statement

Expected Result: PASS

Regression Test:

tcltest::test 14.15-label-10 { continue must occur in a loop statement } {
    
    empty_main T1415l10 {
        int i=0;
        a: do {
            continue a;
        } while (i++<10);
    }

} {PASS}
Test Case: 14.15-label-11
continue must occur in a loop statement

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-label-11 { continue must occur in a loop statement } {
    
    empty_main T1415l11 {
        a: switch (args.length) {
            case 0: continue a;
        }
    }

} {FAIL}
Test Case: 14.15-nonlocal-2
there are no non-local jumps

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-nonlocal-2 { there are no non-local jumps } {
    
    empty_main T1415nonlocal2 {
        a: do {
            new Object() {
                {
                    continue a;
                }
            };
        } while (false);
    }

} {FAIL}
Test Case: 14.15-try-2
the continue can be interrupted by a finally

Expected Result: PASS

Regression Test:

tcltest::test 14.15-try-2 { the continue can be interrupted by a finally } {
    
    empty_main T1415try2 {
        a: do {
            try {
                try {
                    continue a;
                } finally { // discard the continue
                    throw new Exception();
                }
            } catch (Throwable t) { // stop the exception
            }
            int i = 1; // reachable, even though it follows a continue
        } while (false);
    }

} {PASS}
Test Case: 14.15-arg-1
The arg to continue must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-arg-1 { The arg to continue must be an identifier } {
    
    empty_main T1415a1 {
        a: do {
            continue 1;
        } while (false);
    }

} {FAIL}
Test Case: 14.15-arg-2
The arg to continue must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-arg-2 { The arg to continue must be an identifier } {
    
    empty_main T1415a2 {
        a: do {
            continue "a";
        } while (false);
    }

} {FAIL}
Test Case: 14.15-arg-3
The arg to continue must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-arg-3 { The arg to continue must be an identifier } {
    
    empty_main T1415a3 {
        a: do {
            continue (a);
        } while (false);
    }

} {FAIL}
Test Case: 14.15-arg-4
The arg to continue must be an identifier

Expected Result: FAIL

Regression Test:

tcltest::test 14.15-arg-4 { The arg to continue must be an identifier } {
    
    empty_main T1415a4 {
        a: do {
            continue a.a;
        } while (false);
    }

} {FAIL}

14.20

Directory : tests/jls/blocks-and-statements/unreachable-statements


Test Case: 14.20-valid-1
Example of valid unreachable code, since value analysis is not made

Expected Result: PASS

Regression Test:

tcltest::test 14.20-valid-1 { Example of valid unreachable code, since value
        analysis is not made } {
    
    empty_main T1420valid1 {
        int n = 5, k;
        while (n > 7) k = 2;
    }

} {PASS}
Test Case: 14.20-block-1
Empty blocks complete normally iff reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.20-block-1 { Empty blocks complete normally iff reachable } {
    
    empty_main T1420block1 {
        {}
        int i;
    }

} {PASS}
Test Case: 14.20-block-2
Non-empty blocks complete normally iff last statement does

Expected Result: PASS

Regression Test:

tcltest::test 14.20-block-2 { Non-empty blocks complete normally iff last statement does } {
    
    empty_main T1420block2 {
        { int i; }
        int j;
    }

} {PASS}
Test Case: 14.20-block-3
Non-empty blocks complete normally iff last statement does

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-3 { Non-empty blocks complete normally iff last statement does } {
    
    empty_main T1420block3 {
        { return; }
        int i;
    }

} {FAIL}
Test Case: 14.20-block-4
Non-empty blocks complete normally iff last statement does

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-4 { Non-empty blocks complete normally iff last statement does } {
    
    empty_main T1420block4 {
        { return; }
        ;
    }

} {FAIL}
Test Case: 14.20-block-5
Non-empty blocks complete normally iff last statement does

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-5 { Non-empty blocks complete normally iff last statement does } {
    
    empty_main T1420block5 {
        { return; }
        {}
    }

} {FAIL}
Test Case: 14.20-block-6
Non-empty blocks complete normally iff last statement does

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-6 { Non-empty blocks complete normally iff last statement does } {
    
    empty_main T1420block6 {
        { return; }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-block-7
First block statement is reachable iff block is; all others iff the preceding statement completes normally

Expected Result: PASS

Regression Test:

tcltest::test 14.20-block-7 { First block statement is reachable iff block is;
        all others iff the preceding statement completes normally } {
    
    empty_main T1420block7 {
        int i;
        int j;
    }

} {PASS}
Test Case: 14.20-block-8
First block statement is reachable iff block is; all others iff the preceding statement completes normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-8 { First block statement is reachable iff block is;
        all others iff the preceding statement completes normally } {
    
    empty_main T1420block8 {
        return;
        int i;
    }

} {FAIL}
Test Case: 14.20-block-9
First block statement is reachable iff block is; all others iff the preceding statement completes normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-9 { First block statement is reachable iff block is;
        all others iff the preceding statement completes normally } {
    
    empty_main T1420block9 {
        return;
        ;
    }

} {FAIL}
Test Case: 14.20-block-10
First block statement is reachable iff block is; all others iff the preceding statement completes normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-10 { First block statement is reachable iff block is;
        all others iff the preceding statement completes normally } {
    
    empty_main T1420block10 {
        return;
        {}
    }

} {FAIL}
Test Case: 14.20-block-11
First block statement is reachable iff block is; all others iff the preceding statement completes normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-block-11 { First block statement is reachable iff block is;
        all others iff the preceding statement completes normally } {
    
    empty_main T1420block11 {
        return;
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-local-1
Local class declarations can complete normally iff reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.20-local-1 { Local class declarations can complete normally
        iff reachable } {
    
    empty_main T1420local1 {
        class bar {}
        int i;
    }

} {PASS}
Test Case: 14.20-local-2
Local class declarations can complete normally iff reachable

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-local-2 { Local class declarations can complete normally
        iff reachable } {
    
    empty_main T1420local2 {
        return;
        class bar {}
    }

} {FAIL}
Test Case: 14.20-local-3
Local variable declarations can complete normally iff reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.20-local-3 { Local variable declarations can complete normally
        iff reachable } {
    
    empty_main T1420local3 {
        int i;
        int j;
    }

} {PASS}
Test Case: 14.20-local-4
Local variable declarations can complete normally iff reachable

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-local-4 { Local variable declarations can complete normally
        iff reachable } {
    
    empty_main T1420local4 {
        return;
        int j;
    }

} {FAIL}
Test Case: 14.20-empty-1
The empty statement completes normally iff reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.20-empty-1 { The empty statement completes normally iff reachable } {
    
    empty_main T1420empty1 {
        ;
        int i;
    }

} {PASS}
Test Case: 14.20-label-1
Labeled statements can complete normally if contained statement can as well

Expected Result: PASS

Regression Test:

tcltest::test 14.20-label-1 { Labeled statements can complete normally if
        contained statement can as well } {
    
    empty_main T1420label1 {
        int i;
        a: i = 1;
        int j;
    }

} {PASS}
Test Case: 14.20-label-2
Labeled statements can complete normally if it contains a reachable break to exit the label

Expected Result: PASS

Regression Test:

tcltest::test 14.20-label-2 { Labeled statements can complete normally if
        it contains a reachable break to exit the label } {
    
    empty_main T1420label2 {
        a: break a;
        int i;
    }

} {PASS}
Test Case: 14.20-label-3
Labeled statements can complete normally if it contains a reachable break to exit the label

Expected Result: PASS

Regression Test:

tcltest::test 14.20-label-3 { Labeled statements can complete normally if
        it contains a reachable break to exit the label } {
    
    empty_main T1420label3 {
        a: while (true)
            break a;
        int i;
    }

} {PASS}
Test Case: 14.20-label-4
Labeled statements without exiting break or normal completion of contained statement do not complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-4 { Labeled statements without exiting break or
        normal completion of contained statement do not complete normally } {
    
    empty_main T1420label4 {
        a: return;
        int i;
    }

} {FAIL}
Test Case: 14.20-label-5
Labeled statements without exiting break or normal completion of contained statement do not complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-5 { Labeled statements without exiting break or
        normal completion of contained statement do not complete normally } {
    
    empty_main T1420label5 {
        a: return;
        ;
    }

} {FAIL}
Test Case: 14.20-label-6
Labeled statements without exiting break or normal completion of contained statement do not complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-6 { Labeled statements without exiting break or
        normal completion of contained statement do not complete normally } {
    
    empty_main T1420label6 {
        a: return;
        {}
    }

} {FAIL}
Test Case: 14.20-label-7
Labeled statements without exiting break or normal completion of contained statement do not complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-7 { Labeled statements without exiting break or
        normal completion of contained statement do not complete normally } {
    
    empty_main T1420label7 {
        a: return;
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-label-8
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-8 { The break is interrupted by the try-finally } {
    
    empty_main T1420label8 {
        a: try {
            break a;
        } finally {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-label-9
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-9 { The break is interrupted by the try-finally } {
    
    empty_main T1420label9 {
        a: try {
            break a;
        } finally {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-label-10
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-10 { The break is interrupted by the try-finally } {
    
    empty_main T1420label10 {
        a: try {
            break a;
        } finally {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-label-11
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-11 { The break is interrupted by the try-finally } {
    
    empty_main T1420label11 {
        a: try {
            break a;
        } finally {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-label-12
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-12 { The break is interrupted by the try-finally } {
    
    empty_main T1420label12 {
        a: try {
            throw new Exception();
        } catch (Exception e) {
            break a;
        } finally {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-label-13
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-13 { The break is interrupted by the try-finally } {
    
    empty_main T1420label13 {
        a: try {
            throw new Exception();
        } catch (Exception e) {
            break a;
        } finally {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-label-14
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-14 { The break is interrupted by the try-finally } {
    
    empty_main T1420label14 {
        a: try {
            throw new Exception();
        } catch (Exception e) {
            break a;
        } finally {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-label-15
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-label-15 { The break is interrupted by the try-finally } {
    
    empty_main T1420label15 {
        a: try {
            throw new Exception();
        } catch (Exception e) {
            break a;
        } finally {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-expression-1
Expression statements can complete normally iff reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.20-expression-1 { Expression statements can complete normally
        iff reachable } {
    
    empty_main T1420expression1 {
        System.out.println();
        int i;
        i = 1;
        i++;
        --i;
        new Object();
        new Object() {};
    }

} {PASS}
Test Case: 14.20-expression-2
Expression statements can complete normally iff reachable (even if stricter analysis shows otherwise)

Expected Result: PASS

Regression Test:

tcltest::test 14.20-expression-2 { Expression statements can complete normally
        iff reachable (even if stricter analysis shows otherwise) } {
    
    empty_class T1420expression2 {
        void die() { throw new RuntimeException(); }
        void foo() {
            System.exit(1); // never returns
            die(); // always abrupt exit with exception
            Object o = new Object[Integer.MAX_VALUE][Integer.MAX_VALUE][Integer.MAX_VALUE]; // almost a guaranteed OutOfMemoryError
            foo(); // recursion short-circuits rest of method
            int i; // will never get here, but it is reachable
        }
    }

} {PASS}
Test Case: 14.20-switch-1
A switch statement can complete normally if: The last statement in the switch block can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-1 { A switch statement can complete normally if:
        The last statement in the switch block can complete normally. } {
    
    empty_main T1420switch1 {
        switch (args.length) {
            case 0:
            int i;
        }
        int j;
    }

} {PASS}
Test Case: 14.20-switch-2
A switch statement can complete normally if: The switch block is empty or contains only switch labels.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-2 { A switch statement can complete normally if:
        The switch block is empty or contains only switch labels. } {
    
    empty_main T1420switch2 {
        switch (args.length) {}
        int i;
    }

} {PASS}
Test Case: 14.20-switch-3
A switch statement can complete normally if: The switch block is empty or contains only switch labels.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-3 { A switch statement can complete normally if:
        The switch block is empty or contains only switch labels. } {
    
    empty_main T1420switch3 {
        switch (args.length) {
            case 0:
        }
        int i;
    }

} {PASS}
Test Case: 14.20-switch-4
A switch statement can complete normally if: There is at least one switch label after the last switch block statement group.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-4 { A switch statement can complete normally if:
        There is at least one switch label after the last switch block statement group. } {
    
    empty_main T1420switch4 {
        switch (args.length) {
            case 0: return;
            case 1:
        }
        int i;
    }

} {PASS}
Test Case: 14.20-switch-5
A switch statement can complete normally if: The switch block does not contain a default label.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-5 { A switch statement can complete normally if:
        The switch block does not contain a default label. } {
    
    empty_main T1420switch5 {
        switch (args.length) {
            case 0: return;
        }
        int i;
    }

} {PASS}
Test Case: 14.20-switch-6
A switch statement can complete normally if: There is a reachable break statement that exits the switch statement.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-6 { A switch statement can complete normally if:
        There is a reachable break statement that exits the switch statement. } {
    
    empty_main T1420switch6 {
        switch (args.length) {
            default: return;
            case 0: break;
        }
        int i;
    }

} {PASS}
Test Case: 14.20-switch-7
A switch statement cannot complete normally if all five preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-7 { A switch statement cannot complete normally if
        all five preceding conditions are not met } {
    
    empty_main T1420switch7 {
        switch (args.length) {
            default: return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-switch-8
A switch statement cannot complete normally if all five preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-8 { A switch statement cannot complete normally if
        all five preceding conditions are not met } {
    
    empty_main T1420switch8 {
        switch (args.length) {
            default: return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-switch-9
A switch statement cannot complete normally if all five preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-9 { A switch statement cannot complete normally if
        all five preceding conditions are not met } {
    
    empty_main T1420switch9 {
        switch (args.length) {
            default: return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-switch-10
A switch statement cannot complete normally if all five preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-10 { A switch statement cannot complete normally if
        all five preceding conditions are not met } {
    
    empty_main T1420switch10 {
        switch (args.length) {
            default: return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-switch-11
A switchblock statement is reachable if it bears a switch label

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-11 { A switchblock statement is reachable if it
        bears a switch label } {
    
    switch_labels T1420switch11 int {
        case 0: return;
        case 1: boolean b;
    }

} {PASS}
Test Case: 14.20-switch-12
A switchblock statement is reachable if a prior statement can complete normally

Expected Result: PASS

Regression Test:

tcltest::test 14.20-switch-12 { A switchblock statement is reachable if a prior
        statement can complete normally } {
    
    switch_labels T1420switch12 int {
        case 0:
            boolean b1;
            boolean b2;
    }

} {PASS}
Test Case: 14.20-switch-13
A switchblock statement is unreachable iff it bears no label and the prior statement cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-13 { A switchblock statement is unreachable iff it
        bears no label and the prior statement cannot complete normally } {
    
    switch_labels T1420switch13 int {
        case 0: 
            return;
            int i;
    }

} {FAIL}
Test Case: 14.20-switch-14
A switchblock statement is unreachable iff it bears no label and the prior statement cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-14 { A switchblock statement is unreachable iff it
        bears no label and the prior statement cannot complete normally } {
    
    switch_labels T1420switch14 int {
        case 0: 
            return;
            ;
    }

} {FAIL}
Test Case: 14.20-switch-15
A switchblock statement is unreachable iff it bears no label and the prior statement cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-15 { A switchblock statement is unreachable iff it
        bears no label and the prior statement cannot complete normally } {
    
    switch_labels T1420switch15 int {
        case 0: 
            return;
            {}
    }

} {FAIL}
Test Case: 14.20-switch-16
A switchblock statement is unreachable iff it bears no label and the prior statement cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-16 { A switchblock statement is unreachable iff it
        bears no label and the prior statement cannot complete normally } {
    
    switch_labels T1420switch16 int {
        case 0: 
            return;
            { int x=3; }
    }

} {FAIL}
Test Case: 14.20-switch-17
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-17 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch17 {
        switch (args.length) {
            default:
            try {
                break;
            } finally {
                return;
            }
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-switch-18
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-18 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch18 {
        switch (args.length) {
            default:
            try {
                break;
            } finally {
                return;
            }
        }
        ;
    }

} {FAIL}
Test Case: 14.20-switch-19
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-19 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch19 {
        switch (args.length) {
            default:
            try {
                break;
            } finally {
                return;
            }
        }
        {}
    }

} {FAIL}
Test Case: 14.20-switch-20
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-20 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch20 {
        switch (args.length) {
            default:
            try {
                break;
            } finally {
                return;
            }
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-switch-21
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-21 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch21 {
        switch (args.length) {
            default:
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-switch-22
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-22 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch22 {
        switch (args.length) {
            default:
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        ;
    }

} {FAIL}
Test Case: 14.20-switch-23
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-23 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch23 {
        switch (args.length) {
            default:
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        {}
    }

} {FAIL}
Test Case: 14.20-switch-24
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-switch-24 { The break is interrupted by the try-finally } {
    
    empty_main T1420switch24 {
        switch (args.length) {
            default:
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-while-1
A while statement can complete normally if: The condition expression is not a constant expression with value true

Expected Result: PASS

Regression Test:

tcltest::test 14.20-while-1 { A while statement can complete normally if:
        The condition expression is not a constant expression with value true } {
    
    empty_main T1420while1 {
        boolean b = true;
        while (b);
        int j;
    }

} {PASS}
Test Case: 14.20-while-2
A while statement can complete normally if: There is a reachable break statement that exits the while statement.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-while-2 { A while statement can complete normally if:
        There is a reachable break statement that exits the while statement. } {
    
    empty_main T1420while2 {
        while (true) break;
        int i;
    }

} {PASS}
Test Case: 14.20-while-3
A while statement cannot complete normally iff there is no break and the condition is constant true

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-3 { A while statement cannot complete normally iff
        there is no break and the condition is constant true } {
    
    empty_main T1420while3 {
        while (true);
        int i;
    }

} {FAIL}
Test Case: 14.20-while-4
A while statement cannot complete normally iff there is no break and the condition is constant true

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-4 { A while statement cannot complete normally iff
        there is no break and the condition is constant true } {
    
    empty_main T1420while4 {
        while (true);
        ;
    }

} {FAIL}
Test Case: 14.20-while-5
A while statement cannot complete normally iff there is no break and the condition is constant true

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-5 { A while statement cannot complete normally iff
        there is no break and the condition is constant true } {
    
    empty_main T1420while5 {
        while (true);
        {}
    }

} {FAIL}
Test Case: 14.20-while-6
A while statement cannot complete normally iff there is no break and the condition is constant true

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-6 { A while statement cannot complete normally iff
        there is no break and the condition is constant true } {
    
    empty_main T1420while6 {
        while (true);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-while-7
The contained statement of a while is unreachable iff the condition is constant false

Expected Result: PASS

Regression Test:

tcltest::test 14.20-while-7 { The contained statement of a while is unreachable
        iff the condition is constant false } {
    
    empty_main T1420while7 {
        boolean b = false;
        while (b) b = false;
        int i;
    }

} {PASS}
Test Case: 14.20-while-8
The contained statement of a while is unreachable iff the condition is constant false

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-8 { The contained statement of a while is unreachable
        iff the condition is constant false } {
    
    empty_main T1420while8 {
        int i;
        while (false) i = 1;
    }

} {FAIL}
Test Case: 14.20-while-9
The contained statement of a while is unreachable iff the condition is constant false

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-9 { The contained statement of a while is unreachable
        iff the condition is constant false } {
    
    empty_main T1420while9 {
        while (false);
    }

} {FAIL}
Test Case: 14.20-while-10
The contained statement of a while is unreachable iff the condition is constant false

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-10 { The contained statement of a while is unreachable
        iff the condition is constant false } {
    
    empty_main T1420while10 {
        while (false) {}
    }

} {FAIL}
Test Case: 14.20-while-11
The contained statement of a while is unreachable iff the condition is constant false

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-11 { The contained statement of a while is unreachable
        iff the condition is constant false } {
    
    empty_main T1420while11 {
        while (false) { int x=3; }
    }

} {FAIL}
Test Case: 14.20-while-12
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-12 { The break is interrupted by the try-finally } {
    
    empty_main T1420while12 {
        while (true) {
            try {
                break;
            } finally {
                return;
            }
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-while-13
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-13 { The break is interrupted by the try-finally } {
    
    empty_main T1420while13 {
        while (true) {
            try {
                break;
            } finally {
                return;
            }
        }
        ;
    }

} {FAIL}
Test Case: 14.20-while-14
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-14 { The break is interrupted by the try-finally } {
    
    empty_main T1420while14 {
        while (true) {
            try {
                break;
            } finally {
                return;
            }
        }
        {}
    }

} {FAIL}
Test Case: 14.20-while-15
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-15 { The break is interrupted by the try-finally } {
    
    empty_main T1420while15 {
        while (true) {
            try {
                break;
            } finally {
                return;
            }
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-while-16
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-16 { The break is interrupted by the try-finally } {
    
    empty_main T1420while16 {
        while (true) {
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-while-17
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-17 { The break is interrupted by the try-finally } {
    
    empty_main T1420while17 {
        while (true) {
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        ;
    }

} {FAIL}
Test Case: 14.20-while-18
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-18 { The break is interrupted by the try-finally } {
    
    empty_main T1420while18 {
        while (true) {
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        {}
    }

} {FAIL}
Test Case: 14.20-while-19
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-while-19 { The break is interrupted by the try-finally } {
    
    empty_main T1420while19 {
        while (true) {
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-1
A do statement can complete normally if: The contained statement can complete normally and the condition is not constant true

Expected Result: PASS

Regression Test:

tcltest::test 14.20-do-1 { A do statement can complete normally if:
        The contained statement can complete normally and the condition is not constant true } {
    
    empty_main T1420do1 {
        boolean b = true;
        do {} while (b);
        int i;
    }

} {PASS}
Test Case: 14.20-do-2
A do statement can complete normally if: The do statement contains a reachable unlabeled continue statement for the do, with condition not constant true

Expected Result: PASS

Regression Test:

tcltest::test 14.20-do-2 { A do statement can complete normally if:
        The do statement contains a reachable unlabeled continue statement
        for the do, with condition not constant true } {
    
    empty_main T1420do2 {
        boolean b = true;
        do continue; while (b);
        int i;
    }

} {PASS}
Test Case: 14.20-do-3
A do statement can complete normally if: The do statement contains a reachable labeled continue statement for the do, with condition not constant true

Expected Result: PASS

Regression Test:

tcltest::test 14.20-do-3 { A do statement can complete normally if:
        The do statement contains a reachable labeled continue statement
        for the do, with condition not constant true } {
    
    empty_main T1420do3 {
        boolean b = true;
        a: do continue a; while (b);
        int i;
    }

} {PASS}
Test Case: 14.20-do-4
A do statement can complete normally if: There is a reachable break statement that exits the do statement.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-do-4 { A do statement can complete normally if:
        There is a reachable break statement that exits the do statement. } {
    
    empty_main T1420do4 {
        do break; while (true);
        int i;
    }

} {PASS}
Test Case: 14.20-do-5
A do statement cannot complete normally iff all four preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-5 { A do statement cannot complete normally iff
        all four preceding conditions are not met } {
    
    empty_main T1420do5 {
        int i;
        do i = 1;
        while (true);
        int j;
    }

} {FAIL}
Test Case: 14.20-do-6
A do statement cannot complete normally iff all four preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-6 { A do statement cannot complete normally iff
        all four preceding conditions are not met } {
    
    empty_main T1420do6 {
        int i;
        do i = 1;
        while (true);
        ;
    }

} {FAIL}
Test Case: 14.20-do-7
A do statement cannot complete normally iff all four preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-7 { A do statement cannot complete normally iff
        all four preceding conditions are not met } {
    
    empty_main T1420do7 {
        int i;
        do i = 1;
        while (true);
        {}
    }

} {FAIL}
Test Case: 14.20-do-8
A do statement cannot complete normally iff all four preceding conditions are not met

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-8 { A do statement cannot complete normally iff
        all four preceding conditions are not met } {
    
    empty_main T1420do8 {
        int i;
        do i = 1;
        while (true);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-9
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-9 { The break is interrupted by the try-finally } {
    
    empty_main T1420do9 {
        do try {
            break;
        } finally {
            return;
        } while (true);
        int i;
    }

} {FAIL}
Test Case: 14.20-do-10
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-10 { The break is interrupted by the try-finally } {
    
    empty_main T1420do10 {
        do try {
            break;
        } finally {
            return;
        } while (true);
        ;
    }

} {FAIL}
Test Case: 14.20-do-11
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-11 { The break is interrupted by the try-finally } {
    
    empty_main T1420do11 {
        do try {
            break;
        } finally {
            return;
        } while (true);
        {}
    }

} {FAIL}
Test Case: 14.20-do-12
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-12 { The break is interrupted by the try-finally } {
    
    empty_main T1420do12 {
        do try {
            break;
        } finally {
            return;
        } while (true);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-13
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-13 { The break is interrupted by the try-finally } {
    
    empty_main T1420do13 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            break;
        } finally {
            return;
        } while (true);
        int i;
    }

} {FAIL}
Test Case: 14.20-do-14
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-14 { The break is interrupted by the try-finally } {
    
    empty_main T1420do14 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            break;
        } finally {
            return;
        } while (true);
        ;
    }

} {FAIL}
Test Case: 14.20-do-15
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-15 { The break is interrupted by the try-finally } {
    
    empty_main T1420do15 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            break;
        } finally {
            return;
        } while (true);
        {}
    }

} {FAIL}
Test Case: 14.20-do-16
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-16 { The break is interrupted by the try-finally } {
    
    empty_main T1420do16 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            break;
        } finally {
            return;
        } while (true);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-17
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-17 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do17 {
        do try {
            continue;
        } finally {
            return;
        } while (false);
        int i;
    }

} {FAIL}
Test Case: 14.20-do-18
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-18 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do18 {
        do try {
            continue;
        } finally {
            return;
        } while (false);
        ;
    }

} {FAIL}
Test Case: 14.20-do-19
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-19 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do19 {
        do try {
            continue;
        } finally {
            return;
        } while (false);
        {}
    }

} {FAIL}
Test Case: 14.20-do-20
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-20 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do20 {
        do try {
            continue;
        } finally {
            return;
        } while (false);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-21
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-21 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do21 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            continue;
        } finally {
            return;
        } while (false);
        int i;
    }

} {FAIL}
Test Case: 14.20-do-22
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-22 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do22 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            continue;
        } finally {
            return;
        } while (false);
        ;
    }

} {FAIL}
Test Case: 14.20-do-23
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-23 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do23 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            continue;
        } finally {
            return;
        } while (false);
        {}
    }

} {FAIL}
Test Case: 14.20-do-24
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-24 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do24 {
        do try {
            throw new Exception();
        } catch (Exception e) {
            continue;
        } finally {
            return;
        } while (false);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-25
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-25 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do25 {
        a: do try {
            continue a;
        } finally {
            return;
        } while (false);
        int i;
    }

} {FAIL}
Test Case: 14.20-do-26
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-26 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do26 {
        a: do try {
            continue a;
        } finally {
            return;
        } while (false);
        ;
    }

} {FAIL}
Test Case: 14.20-do-27
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-27 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do27 {
        a: do try {
            continue a;
        } finally {
            return;
        } while (false);
        {}
    }

} {FAIL}
Test Case: 14.20-do-28
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-28 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do28 {
        a: do try {
            continue a;
        } finally {
            return;
        } while (false);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-29
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-29 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do29 {
        a: do try {
            throw new Exception();
        } catch (Exception e) {
            continue a;
        } finally {
            return;
        } while (false);
        int i;
    }

} {FAIL}
Test Case: 14.20-do-30
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-30 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do30 {
        a: do try {
            throw new Exception();
        } catch (Exception e) {
            continue a;
        } finally {
            return;
        } while (false);
        ;
    }

} {FAIL}
Test Case: 14.20-do-31
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-31 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do31 {
        a: do try {
            throw new Exception();
        } catch (Exception e) {
            continue a;
        } finally {
            return;
        } while (false);
        {}
    }

} {FAIL}
Test Case: 14.20-do-32
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-32 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do32 {
        a: do try {
            throw new Exception();
        } catch (Exception e) {
            continue a;
        } finally {
            return;
        } while (false);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-do-33
The continue is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-do-33 { The continue is interrupted by the try-finally } {
    
    empty_main T1420do33 {
        a: do {
            try {
                throw new Exception();
            } catch (Exception e) {
                continue a;
            } finally {
                return;
            }
        } while (false);
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-for-1
A for statement can complete normally if: The condition statement exists and is non-constant

Expected Result: PASS

Regression Test:

tcltest::test 14.20-for-1 { A for statement can complete normally if:
        The condition statement exists and is non-constant } {
    
    empty_main T1420for1 {
        boolean b = true;
        for ( ; b; );
        int i;
    }

} {PASS}
Test Case: 14.20-for-2
A for statement can complete normally if: There is a reachable break statement that exits the for statement.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-for-2 { A for statement can complete normally if:
        There is a reachable break statement that exits the for statement. } {
    
    empty_main T1420for2 {
        for ( ; ; ) break;
        int i;
    }

} {PASS}
Test Case: 14.20-for-3
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-3 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for3 {
        for ( ; ; );
        int i;
    }

} {FAIL}
Test Case: 14.20-for-4
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-4 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for4 {
        for ( ; ; );
        ;
    }

} {FAIL}
Test Case: 14.20-for-5
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-5 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for5 {
        for ( ; ; );
        {}
    }

} {FAIL}
Test Case: 14.20-for-6
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-6 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for6 {
        for ( ; ; );
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-for-7
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-7 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for7 {
        for ( ; true; );
        int i;
    }

} {FAIL}
Test Case: 14.20-for-8
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-8 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for8 {
        for ( ; true; );
        ;
    }

} {FAIL}
Test Case: 14.20-for-9
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-9 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for9 {
        for ( ; true; );
        {}
    }

} {FAIL}
Test Case: 14.20-for-10
A for statement cannot complete normally if there is no condition or the condition is constant true, and there is no break

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-10 { A for statement cannot complete normally if there
        is no condition or the condition is constant true, and there is no break } {
    
    empty_main T1420for10 {
        for ( ; true; );
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-for-11
A for statement cannot have a constant false condition

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-11 { A for statement cannot have a constant false condition } {
    
    empty_main T1420for11 {
        int i;
        for( ; false; ) i = 1;
    }

} {FAIL}
Test Case: 14.20-for-12
A for statement cannot have a constant false condition

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-12 { A for statement cannot have a constant false condition } {
    
    empty_main T1420for12 {
        for ( ; false; );
    }

} {FAIL}
Test Case: 14.20-for-13
A for statement cannot have a constant false condition

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-13 { A for statement cannot have a constant false condition } {
    
    empty_main T1420for13 {
        for ( ; false; ) {}
    }

} {FAIL}
Test Case: 14.20-for-14
A for statement cannot have a constant false condition

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-14 { A for statement cannot have a constant false condition } {
    
    empty_main T1420for14 {
        for ( ; false; ) { int x=3; }
    }

} {FAIL}
Test Case: 14.20-for-15
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-15 { The break is interrupted by the try-finally } {
    
    empty_main T1420for15 {
        for ( ; ; )
            try {
                break;
            } finally {
                return;
            }
        int i;
    }

} {FAIL}
Test Case: 14.20-for-16
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-16 { The break is interrupted by the try-finally } {
    
    empty_main T1420for16 {
        for ( ; ; )
            try {
                break;
            } finally {
                return;
            }
        ;
    }

} {FAIL}
Test Case: 14.20-for-17
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-17 { The break is interrupted by the try-finally } {
    
    empty_main T1420for17 {
        for ( ; ; )
            try {
                break;
            } finally {
                return;
            }
        {}
    }

} {FAIL}
Test Case: 14.20-for-18
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-18 { The break is interrupted by the try-finally } {
    
    empty_main T1420for18 {
        for ( ; ; )
            try {
                break;
            } finally {
                return;
            }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-for-19
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-19 { The break is interrupted by the try-finally } {
    
    empty_main T1420for19 {
        for ( ; ; )
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        int i;
    }

} {FAIL}
Test Case: 14.20-for-20
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-20 { The break is interrupted by the try-finally } {
    
    empty_main T1420for20 {
        for ( ; ; )
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        ;
    }

} {FAIL}
Test Case: 14.20-for-21
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-21 { The break is interrupted by the try-finally } {
    
    empty_main T1420for21 {
        for ( ; ; )
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        {}
    }

} {FAIL}
Test Case: 14.20-for-22
The break is interrupted by the try-finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-for-22 { The break is interrupted by the try-finally } {
    
    empty_main T1420for22 {
        for ( ; ; )
            try {
                throw new Exception();
            } catch (Exception e) {
                break;
            } finally {
                return;
            }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-abrupt-1
break cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-1 { break cannot complete normally } {
    
    empty_main T1420abrupt1 {
        while (true) {
            break;
            int i;
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-2
break cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-2 { break cannot complete normally } {
    
    empty_main T1420abrupt2 {
        while (true) {
            break;
            ;
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-3
break cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-3 { break cannot complete normally } {
    
    empty_main T1420abrupt3 {
        while (true) {
            break;
            {}
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-4
break cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-4 { break cannot complete normally } {
    
    empty_main T1420abrupt4 {
        while (true) {
            break;
            { int x=3; }
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-5
continue cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-5 { continue cannot complete normally } {
    
    empty_main T1420abrupt5 {
        while (true) {
            continue;
            int i;
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-6
continue cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-6 { continue cannot complete normally } {
    
    empty_main T1420abrupt6 {
        while (true) {
            continue;
            ;
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-7
continue cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-7 { continue cannot complete normally } {
    
    empty_main T1420abrupt7 {
        while (true) {
            continue;
            {}
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-8
continue cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-8 { continue cannot complete normally } {
    
    empty_main T1420abrupt8 {
        while (true) {
            continue;
            { int x=3; }
        }
    }

} {FAIL}
Test Case: 14.20-abrupt-9
return cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-9 { return cannot complete normally } {
    
    empty_main T1420abrupt9 {
        return;
        int i;
    }

} {FAIL}
Test Case: 14.20-abrupt-10
return cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-10 { return cannot complete normally } {
    
    empty_main T1420abrupt10 {
        return;
        ;
    }

} {FAIL}
Test Case: 14.20-abrupt-11
return cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-11 { return cannot complete normally } {
    
    empty_main T1420abrupt11 {
        return;
        {}
    }

} {FAIL}
Test Case: 14.20-abrupt-12
return cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-12 { return cannot complete normally } {
    
    empty_main T1420abrupt12 {
        return;
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-abrupt-13
throw cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-13 { throw cannot complete normally } {
    
    empty_main T1420abrupt13 {
        throw new RuntimeException();
        int i;
    }

} {FAIL}
Test Case: 14.20-abrupt-14
throw cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-14 { throw cannot complete normally } {
    
    empty_main T1420abrupt14 {
        throw new RuntimeException();
        ;
    }

} {FAIL}
Test Case: 14.20-abrupt-15
throw cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-15 { throw cannot complete normally } {
    
    empty_main T1420abrupt15 {
        throw new RuntimeException();
        {}
    }

} {FAIL}
Test Case: 14.20-abrupt-16
throw cannot complete normally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-abrupt-16 { throw cannot complete normally } {
    
    empty_main T1420abrupt16 {
        throw new RuntimeException();
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-synchronized-1
synchronized completes normally iff the contained block does as well

Expected Result: PASS

Regression Test:

tcltest::test 14.20-synchronized-1 { synchronized completes normally iff the
        contained block does as well } {
    
    empty_main T1420synch1 {
        synchronized (args) {}
        int i;
    }

} {PASS}
Test Case: 14.20-synchronized-2
synchronized completes normally iff the contained block does as well

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-synchronized-2 { synchronized completes normally iff the
        contained block does as well } {
    
    empty_main T1420synch2 {
        synchronized (args) {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-synchronized-3
synchronized completes normally iff the contained block does as well

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-synchronized-3 { synchronized completes normally iff the
        contained block does as well } {
    
    empty_main T1420synch3 {
        synchronized (args) {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-synchronized-4
synchronized completes normally iff the contained block does as well

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-synchronized-4 { synchronized completes normally iff the
        contained block does as well } {
    
    empty_main T1420synch4 {
        synchronized (args) {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-synchronized-5
synchronized completes normally iff the contained block does as well

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-synchronized-5 { synchronized completes normally iff the
        contained block does as well } {
    
    empty_main T1420synch5 {
        synchronized (args) {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-1
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-try-1 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try1 {
        try {
            new Object();
        } catch (RuntimeException e) {
            return;
        }
        int i;
    }

} {PASS}
Test Case: 14.20-try-2
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-2 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try2 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-3
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-3 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try3 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-4
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-4 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try4 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-5
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-5 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try5 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-6
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-try-6 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try6 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } catch (Throwable t) {
        }
        int i;
    }

} {PASS}
Test Case: 14.20-try-7
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-try-7 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try7 {
        try {
            new Object();
        } catch (RuntimeException e) {
            return;
        } finally {
        }
        int i;
    }

} {PASS}
Test Case: 14.20-try-8
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-8 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try8 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-9
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-9 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try9 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-10
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-10 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try10 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-11
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-11 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try11 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-12
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-try-12 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try12 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } catch (Throwable t) {
        } finally {
        }
        int i;
    }

} {PASS}
Test Case: 14.20-try-13
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-13 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try13 {
        try {
            new Object();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-14
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-14 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try14 {
        try {
            new Object();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-15
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-15 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try15 {
        try {
            new Object();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-16
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-16 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try16 {
        try {
            new Object();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-17
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-17 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try17 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-18
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-18 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try18 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-19
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-19 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try19 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-20
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-20 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try20 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } finally {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-21
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-21 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try21 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } catch (Throwable t) {
        } finally {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-22
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-22 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try22 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } catch (Throwable t) {
        } finally {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-23
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-23 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try23 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } catch (Throwable t) {
        } finally {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-24
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-24 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try24 {
        try {
            throw new Exception();
        } catch (Exception e) {
            return;
        } catch (Throwable t) {
        } finally {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-25
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-try-25 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try25 {
        try {
            new Object();
        } finally {
        }
        int i;
    }

} {PASS}
Test Case: 14.20-try-26
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-26 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try26 {
        try {
            throw new RuntimeException();
        } finally {
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-27
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-27 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try27 {
        try {
            throw new RuntimeException();
        } finally {
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-28
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-28 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try28 {
        try {
            throw new RuntimeException();
        } finally {
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-29
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-29 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try29 {
        try {
            throw new RuntimeException();
        } finally {
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-30
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-30 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try30 {
        try {
            new Object();
        } finally {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-31
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-31 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try31 {
        try {
            new Object();
        } finally {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-32
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-32 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try32 {
        try {
            new Object();
        } finally {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-33
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-33 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try33 {
        try {
            new Object();
        } finally {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-try-34
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-34 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try34 {
        try {
            throw new Exception();
        } finally {
            return;
        }
        int i;
    }

} {FAIL}
Test Case: 14.20-try-35
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-35 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try35 {
        try {
            throw new Exception();
        } finally {
            return;
        }
        ;
    }

} {FAIL}
Test Case: 14.20-try-36
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-36 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try36 {
        try {
            throw new Exception();
        } finally {
            return;
        }
        {}
    }

} {FAIL}
Test Case: 14.20-try-37
A try statement can complete normally iff both: The try block can complete normally or any catch block can complete normally. The finally block, if present, can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-try-37 { A try statement can complete normally iff both:
        The try block can complete normally or any catch block can complete normally.
        The finally block, if present, can complete normally. } {
    
    empty_main T1420try37 {
        try {
            throw new Exception();
        } finally {
            return;
        }
        { int x=3; }
    }

} {FAIL}
Test Case: 14.20-catch-1
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-1 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch1 {
        try { // empty block cannot throw exception
        } catch (Throwable t) {
        }
    }

} {FAIL}
Test Case: 14.20-catch-2
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-2 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch2 {
        try {
            int i = 0;
            i /= i;
        } catch (ClassCastException e) {
        }
    }

} {FAIL}
Test Case: 14.20-catch-3
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-catch-3 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch3 {
        try {
            throw new Exception();
        } catch (Exception e) {
        }
    }

} {PASS}
Test Case: 14.20-catch-4
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-4 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch4 {
        try {
            throw new Exception();
        } catch (Throwable t) {
        } catch (Exception e) {
        }
    }

} {FAIL}
Test Case: 14.20-catch-5
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-catch-5 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch5 {
        try {
            throw new Exception();
        } catch (Exception e) {
        } catch (Throwable t) {
            // possible Error creating new Exception
        }
    }

} {PASS}
Test Case: 14.20-catch-6
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-catch-6 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch6 {
        try {
            new Object();
        } catch (RuntimeException e) {
        } catch (Error err) {
        }
    }

} {PASS}
Test Case: 14.20-catch-7
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: OK

Regression Test:

tcltest::test 14.20-catch-7 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    ok_pass_or_warn [compile [saveas T1420catch7.java {
class T1420catch7 {
    void foo() {
        try {
            new Object();
        } catch (Exception e) {
        } catch (Throwable t) {
        }
    }
}
    }]]

} {OK}
Test Case: 14.20-catch-8
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-8 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch8 {
        try {
            throw new Exception();
        } catch (Exception e) {
        } catch (Exception e1) {
        }
    }

} {FAIL}
Test Case: 14.20-catch-9
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-catch-9 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch9 {
        int i, j=0;
        try {
            i = 1/j;
        } catch (ArithmeticException ae) {
        }
    }

} {PASS}
Test Case: 14.20-catch-10
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-10 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch10 {
        int i, j=0;
        try {
            i = 1/j;
        } catch (ArithmeticException ae) {
        } catch (RuntimeException re) {
            // the only possible exception, ae, has already been caught
        }
    }

} {FAIL}
Test Case: 14.20-catch-11
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-catch-11 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_class T1420catch11 {
        void choke() throws Exception {
            throw new java.io.IOException();
        }
        void foo() throws Exception {
            try {
                choke();
            } catch (java.io.IOException io) {
                // reachable, as choke() can throw any subclass
            }
        }
    }

} {PASS}
Test Case: 14.20-catch-12
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-12 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_class T1420catch12 {
        void foo() throws Exception {
            try {
                throw new Exception();
            } catch (java.io.IOException io) {
                // unreachable, as new cannot create subclass, and
                // the constructor has no throws clause
            }
        }
    }

} {FAIL}
Test Case: 14.20-catch-13
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-13 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch13 {
        try {
            return;
        } catch (RuntimeException e) {
            // this cannot be thrown
        }
    }

} {FAIL}
Test Case: 14.20-catch-14
The throw is interrupted by the inner finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-14 { The throw is interrupted by the inner finally } {
    
    empty_main T1420catch14 {
        Exception e = new Exception(); // create here to make test work
        try {
            try {
                throw e;
            } finally {
                return;
            }
        } catch (Exception e1) {
            // this is unreachable
        }
    }

} {FAIL}
Test Case: 14.20-catch-15
The throw is interrupted by the inner finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-15 { The throw is interrupted by the inner finally } {
    
    empty_main T1420catch15 {
        try {
            try {
                throw new java.io.IOException();
            } finally {
                return;
            }
        } catch (java.io.IOException e) {
            // this is unreachable
        }
    }

} {FAIL}
Test Case: 14.20-catch-16
The throw is interrupted by the inner finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-16 { The throw is interrupted by the inner finally } {
    
    empty_main T1420catch16 {
        Exception e = new Exception(); // create here to make test work
        try {
            try {
                throw e;
            } catch (Exception e1) {
                throw e1;
            } finally {
                return;
            }
        } catch (Exception e2) {
            // this is unreachable
        }
    }

} {FAIL}
Test Case: 14.20-catch-17
The throw is interrupted by the inner finally

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-17 { The throw is interrupted by the inner finally } {
    
    empty_main T1420catch17 {
        try {
            try {
                throw new java.io.IOException();
            } catch (java.io.IOException e) {
                throw e;
            } finally {
                return;
            }
        } catch (java.io.IOException e1) {
            // this is unreachable
        }
    }

} {FAIL}
Test Case: 14.20-catch-18
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-18 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch18 {
        try {
            try {
                throw new Exception();
            } catch (Throwable t) {
            }
        } catch (Exception e) {
            // this is unreachable
        }
    }

} {FAIL}
Test Case: 14.20-catch-19
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-catch-19 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_class T1420catch19 {
        class MyException extends java.io.IOException {}
        void foo() throws Exception {
            java.io.IOException io = new MyException();
            try {
                throw io;
            } catch (MyException e) {
                // reachable, as variable reference can contain subclass
            }
        }
    }

} {PASS}
Test Case: 14.20-catch-20
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-catch-20 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch20 {
        class MyException extends ArithmeticException {}
        try {
            int i = 0;
            i /= i;
        } catch (MyException e) {
            // unreachable, as expressions do not throw subclass
        }
    }

} {FAIL}
Test Case: 14.20-catch-21
A catch block C is reachable iff both: Some reachable expression or throw statement throws assignable exception. No earlier catch block covers type C or superclass.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-catch-21 { A catch block C is reachable iff both:
        Some reachable expression or throw statement throws assignable exception.
        No earlier catch block covers type C or superclass. } {
    
    empty_main T1420catch21 {
        final Exception e = new java.io.IOException();
        try {
            throw e;
        } catch (java.io.IOException io) {
            // this one will be called
        } catch (Exception ex) {
            // this one is reachable, but will never be executed,
            // since analysis does not evaluate variable contents
        }
    }

} {PASS}
Test Case: 14.20-if-1
if-then can complete normally iff it is reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.20-if-1 { if-then can complete normally iff it is reachable } {
    
    empty_main T1420if1 {
        if (true)
            return;
        int i;
    }

} {PASS}
Test Case: 14.20-if-2
then-statement of if-then is reachable

Expected Result: PASS

Regression Test:

tcltest::test 14.20-if-2 { then-statement of if-then is reachable } {
    
    empty_main T1420if2 {
        int i;
        if (false)
           i = 1;
    }

} {PASS}
Test Case: 14.20-if-3
if-then-else can complete normally iff then-statement or else-statement can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-if-3 { if-then-else can complete normally iff
        then-statement or else-statement can complete normally. } {
    
    empty_main T1420if3 {
        if (true)
            return;
        else
            ;
        int i;
    }

} {PASS}
Test Case: 14.20-if-4
if-then-else can complete normally iff then-statement or else-statement can complete normally.

Expected Result: PASS

Regression Test:

tcltest::test 14.20-if-4 { if-then-else can complete normally iff
        then-statement or else-statement can complete normally. } {
    
    empty_main T1420if4 {
        if (false)
            ;
        else
            return;
        int i;
    }

} {PASS}
Test Case: 14.20-if-5
if-then-else can complete normally iff then-statement or else-statement can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-if-5 { if-then-else can complete normally iff
        then-statement or else-statement can complete normally. } {
    
    empty_main T1420if5 {
        if (true)
            return;
        else
            return;
        int i;
    }

} {FAIL}
Test Case: 14.20-if-6
if-then-else can complete normally iff then-statement or else-statement can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-if-6 { if-then-else can complete normally iff
        then-statement or else-statement can complete normally. } {
    
    empty_main T1420if6 {
        if (true)
            return;
        else
            return;
        ;
    }

} {FAIL}
Test Case: 14.20-if-7
if-then-else can complete normally iff then-statement or else-statement can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-if-7 { if-then-else can complete normally iff
        then-statement or else-statement can complete normally. } {
    
    empty_main T1420if7 {
        if (true)
            return;
        else
            return;
        {}
    }

} {FAIL}
Test Case: 14.20-if-8
if-then-else can complete normally iff then-statement or else-statement can complete normally.

Expected Result: FAIL

Regression Test:

tcltest::test 14.20-if-8 { if-then-else can complete normally iff
        then-statement or else-statement can complete normally. } {
    
    empty_main T1420if8 {
        if (true)
            return;
        else
            return;
        { int x=3; }
    }

} {FAIL}

15.9

Directory : tests/jls/expressions/class-instance-creation


Test Case: 15.9-unqualified-1
a ClassInstanceCreationExpression that starts with the keyword new is known as an unqualified class instance creation expression

Expected Result: PASS

Regression Test:

tcltest::test 15.9-unqualified-1 { a
        ClassInstanceCreationExpression
        that starts with the keyword new
        is known as an unqualified class
        instance creation expression } {
    

    empty_class T159u1 {
        Object o = new T159u1();
    }

} {PASS}
Test Case: 15.9-unqualified-2
an unqualified class instance creation expression can create instances of a toplevel, member, local, or anonymous class

Expected Result: PASS

Regression Test:

tcltest::test 15.9-unqualified-2 { an
        unqualified class instance
        creation expression can create
        instances of a toplevel, member,
        local, or anonymous class } {
    

    empty_class T159u2 {
        class Inner {}
        static class Sinner {}
        void foo() {
            new T159u2(); // toplevel
            new Inner(); // member
            new Sinner(); // static member

            class Local {}
            new Local(); // local

            new T159u2() {}; // anonymous
        }
    }

} {PASS}

15.9.1

Directory : tests/jls/expressions/class-instance-creation/determining-the-class


Test Case: 15.9.1-unqualified-anonymous-1
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-1 { The ClassOrInterfaceType must
        be accessible } {
    
    empty_main T1591ua1 {
        new java.lang.Object(){};
        new T1591ua1(){};
    }

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-2
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-2 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua2_1.java {
package p1;
public class T1591ua2_1 {}
    }] [saveas p2/T1591ua2_2.java {
package p2;
import p1.*;
class T1591ua2_2 extends p1.T1591ua2_1 {
    Object o1 = new p1.T1591ua2_1(){};
    Object o2 = new T1591ua2_1(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-3
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-3 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua3_1.java {
package p1;
class T1591ua3_1 {}
    }] [saveas p2/T1591ua3_2.java {
package p2;
import p1.*;
class T1591ua3_2 extends p1.T1591ua3_1 {
    Object o1 = new p1.T1591ua3_1(){};
    Object o2 = new T1591ua3_1(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-4
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-4 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua4_1.java {
package p1;
public class T1591ua4_1 {
    public class Inner{}
}
    }] [saveas p2/T1591ua4_2.java {
package p2;
import p1.*;
class T1591ua4_2 extends p1.T1591ua4_1 {
    Object o1 = new p1.T1591ua4_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-5
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-5 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua5_1.java {
package p1;
public class T1591ua5_1 {
    protected class Inner{}
}
    }] [saveas p2/T1591ua5_2.java {
package p2;
import p1.*;
class T1591ua5_2 extends p1.T1591ua5_1 {
    Object o1 = new p1.T1591ua5_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-6
The ClassOrInterfaceType must be accessible, the inner class is has package access so it is not accessible from another package

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-6 { The ClassOrInterfaceType must
        be accessible, the inner class is has package access so it
        is not accessible from another package } {
    
    compile [saveas p1/T1591ua6_1.java {
package p1;
public class T1591ua6_1 {
    class Inner{}
}
    }] [saveas p2/T1591ua6_2.java {
package p2;
import p1.*;
class T1591ua6_2 extends p1.T1591ua6_1 {
    Object o1 = new p1.T1591ua6_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-7
The ClassOrInterfaceType must be accessible, this inner class is private

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-7 { The ClassOrInterfaceType must
        be accessible, this inner class is private } {
    
    compile [saveas p1/T1591ua7_1.java {
package p1;
public class T1591ua7_1 {
    private class Inner{}
}
    }] [saveas p2/T1591ua7_2.java {
package p2;
import p1.*;
class T1591ua7_2 extends p1.T1591ua7_1 {
    Object o1 = new p1.T1591ua7_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-8
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-8 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591ua8_1.java {
class T1591ua8_1 {
    protected class Inner{}
}
class T1591ua8_2 extends T1591ua8_1 {
    Object o1 = new T1591ua8_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-9
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-9 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591ua9_1.java {
class T1591ua9_1 {
    class Inner{}
}
class T1591ua9_2 extends T1591ua9_1 {
    Object o1 = new T1591ua9_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-10
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-10 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591ua10_1.java {
class T1591ua10_1 {
    private class Inner{}
}
class T1591ua10_2 extends T1591ua10_1 {
    Object o1 = new T1591ua10_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-11
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-11 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591ua11.java {
interface I1591ua11 {}
class T1591ua11 {
    Object o1 = new java.lang.Cloneable(){};
    Object o2 = new I1591ua11(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-12
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-12 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua12_1.java {
package p1;
public interface T1591ua12_1 {}
    }] [saveas p2/T1591ua12_2.java {
package p2;
import p1.*;
class T1591ua12_2 implements p1.T1591ua12_1 {
    Object o1 = new p1.T1591ua12_1(){};
    Object o2 = new T1591ua12_1(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-13
The ClassOrInterfaceType must be accessible, this interface has package access

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-13 { The ClassOrInterfaceType must
        be accessible, this interface has package access } {
    
    compile [saveas p1/T1591ua13_1.java {
package p1;
interface T1591ua13_1 {}
    }] [saveas p2/T1591ua13_2.java {
package p2;
import p1.*;
class T1591ua13_2 implements p1.T1591ua13_1 {
    Object o1 = new p1.T1591ua13_1(){};
    Object o2 = new T1591ua13_1(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-14
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-14 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua14_1.java {
package p1;
public class T1591ua14_1 {
    public interface Inner{}
}
    }] [saveas p2/T1591ua14_2.java {
package p2;
import p1.*;
class T1591ua14_2 extends p1.T1591ua14_1 {
    Object o1 = new p1.T1591ua14_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-15
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-15 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua15_1.java {
package p1;
public class T1591ua15_1 {
    protected interface Inner{}
}
    }] [saveas p2/T1591ua15_2.java {
package p2;
import p1.*;
class T1591ua15_2 extends p1.T1591ua15_1 {
    Object o1 = new p1.T1591ua15_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-16
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-16 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua16_1.java {
package p1;
public class T1591ua16_1 {
    interface Inner{}
}
    }] [saveas p2/T1591ua16_2.java {
package p2;
import p1.*;
class T1591ua16_2 extends p1.T1591ua16_1 {
    Object o1 = new p1.T1591ua16_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-17
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-17 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591ua17_1.java {
package p1;
public class T1591ua17_1 {
    private interface Inner{}
}
    }] [saveas p2/T1591ua17_2.java {
package p2;
import p1.*;
class T1591ua17_2 extends p1.T1591ua17_1 {
    Object o1 = new p1.T1591ua17_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-18
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-18 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591ua18_1.java {
class T1591ua18_1 {
    protected interface Inner{}
}
class T1591ua18_2 extends T1591ua18_1 {
    Object o1 = new T1591ua18_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-19
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-19 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591ua19_1.java {
class T1591ua19_1 {
    interface Inner{}
}
class T1591ua19_2 extends T1591ua19_1 {
    Object o1 = new T1591ua19_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-20
The ClassOrInterfaceType must be accessible, this inner class has private access

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-20 { The ClassOrInterfaceType must
        be accessible, this inner class has private access } {
    
    compile [saveas T1591ua20_1.java {
class T1591ua20_1 {
    private interface Inner{}
}
class T1591ua20_2 extends T1591ua20_1 {
    Object o1 = new T1591ua20_1.Inner(){};
    Object o2 = new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-21
Anonymous classes cannot extend final class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-21 { Anonymous classes cannot
        extend final class } {
    
    empty_class T1591ua21 {
        final class Inner{}
        Object o1 = new T1591ua21.Inner(){};
        Object o2 = new Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-22
Anonymous classes may extend abstract class

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-22 { Anonymous classes may
        extend abstract class } {
    
    empty_class T1591ua22 {
        abstract class Inner{}
        Object o1 = new T1591ua22.Inner(){};
        Object o2 = new Inner(){};
    }

} {PASS}
Test Case: 15.9.1-unqualified-anonymous-23
The name may not be ambiguous, in this case Inner is ambiguous even though one is an inner class and cannot be constructed without an enclosing instance

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-23 { The name may not be ambiguous,
        in this case Inner is ambiguous even though one is an inner class and
        cannot be constructed without an enclosing instance } {
    
    compile [saveas T1591ua23_1.java {
class T1591ua23_1 {
    class Inner{}
}
interface T1591ua23_2 {
    class Inner{}
}
class T1591ua23_3 extends T1591ua23_1 implements T1591ua23_2 {
    static Object o = new T1591ua23_3.Inner(){};
}
n    }]

} {FAIL}
Test Case: 15.9.1-unqualified-anonymous-24
The name may not be ambiguous, accessibility means that only one Inner is inherited

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-anonymous-24 { The name may not be ambiguous,
        accessibility means that only one Inner is inherited } {
    
    compile [saveas p1/T1591ua24_1.java {
package p1;
public class T1591ua24_1 {
    static class Inner{}
}
    }] [saveas p2/T1591ua24_2.java {
package p2;
import p1.*;
interface T1591ua24_2 {
    class Inner{}
}
class T1591ua24_3 extends T1591ua24_1 implements T1591ua24_2 {
    static Object o = new T1591ua24_3.Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-anonymous-1
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-1 { The simple name must be an
        accessible inner class of the qualifier } {
    
    empty_class T1591qa1 {
        class Inner{}
        Object o = new T1591qa1().new Inner(){};
    }

} {PASS}
Test Case: 15.9.1-qualified-anonymous-2
Anonymous classes cannot extend final class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-2 { Anonymous classes cannot
        extend final class } {
    
    empty_class T1591qa2 {
        final class Inner{}
        Object o = new T1591qa2().new Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-3
Anonymous classes may extend abstract class

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-3 { Anonymous classes may
        extend abstract class } {
    
    empty_class T1591qa3 {
        abstract class Inner{}
        Object o = new T1591qa3().new Inner(){};
    }

} {PASS}
Test Case: 15.9.1-qualified-anonymous-4
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-4 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qa4_1.java {
package p1;
public class T1591qa4_1 {
    public class Inner{}
}
    }] [saveas p2/T1591qa4_2.java {
package p2;
import p1.*;
class T1591qa4_2 extends p1.T1591qa4_1 {
    Object o = new p1.T1591qa4_1().new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-anonymous-5
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-5 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qa5_1.java {
package p1;
public class T1591qa5_1 {
    protected class Inner{}
}
    }] [saveas p2/T1591qa5_2.java {
package p2;
import p1.*;
class T1591qa5_2 extends p1.T1591qa5_1 {
    Object o = new p1.T1591qa5_1().new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-anonymous-6
The simple name must be an accessible inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-6 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qa6_1.java {
package p1;
public class T1591qa6_1 {
    class Inner{}
}
    }] [saveas p2/T1591qa6_2.java {
package p2;
import p1.*;
class T1591qa6_2 extends p1.T1591qa6_1 {
    Object o = new p1.T1591qa6_1().new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-7
The simple name must be an accessible inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-7 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qa7_1.java {
package p1;
public class T1591qa7_1 {
    private class Inner{}
}
    }] [saveas p2/T1591qa7_2.java {
package p2;
import p1.*;
class T1591qa7_2 extends p1.T1591qa7_1 {
    Object o = new p1.T1591qa7_1().new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-8
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-8 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas T1591qa8_1.java {
class T1591qa8_1 {
    protected class Inner{}
}
class T1591qa8_2 extends T1591qa8_1 {
    Object o = new T1591qa8_1().new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-anonymous-9
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-9 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas T1591qa9_1.java {
class T1591qa9_1 {
    class Inner{}
}
class T1591qa9_2 extends T1591qa9_1 {
    Object o = new T1591qa9_1().new Inner(){};
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-anonymous-10
The simple name must be an accessible inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-10 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas T1591qa10_1.java {
class T1591qa10_1 {
    private class Inner{}
}
class T1591qa10_2 extends T1591qa10_1 {
    Object o = new T1591qa10_1().new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-11
The qualified name must be simple

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-11 { The qualified name must be simple } {
    
    empty_class T1591qa11 {
        class Inner{}
        Object o = new T1591qa11().new T1591qa11.Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-12
The qualified name must be an inner class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-12 { The qualified name must be an
        inner class } {
    
    empty_class T1591qa12 {
        static class Inner{}
        Object o = new T1591qa12().new Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-13
The qualified name must be an inner class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-13 { The qualified name must be an
        inner class } {
    
    empty_class T1591qa13 {
        interface Inner{}
        Object o = new T1591qa13().new Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-14
The qualified name must be an inner class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-14 { The qualified name must be an
        inner class } {
    
    empty_class T1591qa13 {
        Object o = new T1591qa13().new Object(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-15
The anonymous class extends the inner class of the type of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-15 { The anonymous class extends
        the inner class of the type of the qualifier } {
    
    empty_class T1591qa15 {
        class Inner{}
        Object o = new T1591qa15(){}.new Inner(){};
    }

} {PASS}
Test Case: 15.9.1-qualified-anonymous-16
The anonymous class extends the inner class of the type of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-16 { The anonymous class extends
        the inner class of the type of the qualifier } {
    
    empty_class T1591qa16 {
        Object o = new T1591qa16(){
            class Inner{}
        }.new Inner(){};
    }

} {PASS}
Test Case: 15.9.1-qualified-anonymous-17
The anonymous class extends the inner class of the type of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-17 { The anonymous class extends
        the inner class of the type of the qualifier } {
    
    empty_class T1591qa17 {
        class Inner {
            static final int foo = 1;
        }
        Object o = new T1591qa17(){
            class Inner {
                static final int foo = 2;
            }
        }.new Inner(){
            {
                switch (1) {
                    case 0:
                    case ((foo == 2) ? 1 : 0):
                }
            }
        };
    }

} {PASS}
Test Case: 15.9.1-qualified-anonymous-18
The name may not be ambiguous, even though only one is an inner class since member classes of interfaces are static and do not have enclosing instance

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-18 { The name may not be ambiguous,
        even though only one is an inner class since member classes of
        interfaces are static and do not have enclosing instance } {
    
    compile [saveas T1591qa18_1.java {
class T1591qa18_1 {
    class Inner{}
}
interface T1591qa18_2 {
    class Inner{}
}
class T1591qa18_3 extends T1591qa18_1 implements T1591qa18_2 {
    Object o = new T1591qa18_3().new Inner(){};
}
n    }]

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-19
The qualifier must be a reference

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-19 { The qualifier must be a reference } {
    
    empty_class T1591qa19 {
        class Inner{}
        int foo() { return 1; }
        Object o = foo().new Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-20
The qualifier must be a reference

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-20 { The qualifier must be a reference } {
    
    empty_class T1591qa20 {
        class Inner{}
        Object o = null.new Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-21
The qualifier must be a reference

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-21 { The qualifier must be a reference } {
    
    empty_class T1591qa21 {
        class Inner{}
        Object o = System.out.println().new Inner(){};
    }

} {FAIL}
Test Case: 15.9.1-qualified-anonymous-22
The qualified name must be an inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-anonymous-22 { The qualified name must be an
        inner class of the qualifier } {
    
    compile [saveas T1591qa22_1.java {
class T1591qa22_1 {}
class T1591qa22_2 extends T1591qa22_1 {
    class Inner{}
    Object o = new T1591qa22_1().new Inner(){};
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-1
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-1 { The ClassOrInterfaceType must
        be accessible } {
    
    empty_main T1591uc1 {
        new java.lang.Object();
        new T1591uc1();
    }

} {PASS}
Test Case: 15.9.1-unqualified-concrete-2
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-2 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591uc2_1.java {
package p1;
public class T1591uc2_1 {}
    }] [saveas p2/T1591uc2_2.java {
package p2;
import p1.*;
class T1591uc2_2 extends p1.T1591uc2_1 {
    Object o1 = new p1.T1591uc2_1();
    Object o2 = new T1591uc2_1();
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-concrete-3
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-3 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591uc3_1.java {
package p1;
class T1591uc3_1 {}
    }] [saveas p2/T1591uc3_2.java {
package p2;
import p1.*;
class T1591uc3_2 extends p1.T1591uc3_1 {
    Object o1 = new p1.T1591uc3_1();
    Object o2 = new T1591uc3_1();
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-4
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-4 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591uc4_1.java {
package p1;
public class T1591uc4_1 {
    public class Inner{}
}
    }] [saveas p2/T1591uc4_2.java {
package p2;
import p1.*;
class T1591uc4_2 extends p1.T1591uc4_1 {
    Object o1 = new p1.T1591uc4_1.Inner();
    Object o2 = new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-concrete-5
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-5 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591uc5_1.java {
package p1;
public class T1591uc5_1 {
    protected class Inner{
        public Inner(){}
    }
}
    }] [saveas p2/T1591uc5_2.java {
package p2;
import p1.*;
class T1591uc5_2 extends p1.T1591uc5_1 {
    Object o1 = new p1.T1591uc5_1.Inner();
    Object o2 = new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-concrete-6
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-6 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591uc6_1.java {
package p1;
public class T1591uc6_1 {
    class Inner{}
}
    }] [saveas p2/T1591uc6_2.java {
package p2;
import p1.*;
class T1591uc6_2 extends p1.T1591uc6_1 {
    Object o1 = new p1.T1591uc6_1.Inner();
    Object o2 = new Inner();
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-7
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-7 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas p1/T1591uc7_1.java {
package p1;
public class T1591uc7_1 {
    private class Inner{}
}
    }] [saveas p2/T1591uc7_2.java {
package p2;
import p1.*;
class T1591uc7_2 extends p1.T1591uc7_1 {
    Object o1 = new p1.T1591uc7_1.Inner();
    Object o2 = new Inner();
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-8
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-8 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591uc8_1.java {
class T1591uc8_1 {
    protected class Inner{}
}
class T1591uc8_2 extends T1591uc8_1 {
    Object o1 = new T1591uc8_1.Inner();
    Object o2 = new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-concrete-9
The ClassOrInterfaceType must be accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-9 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591uc9_1.java {
class T1591uc9_1 {
    class Inner{}
}
class T1591uc9_2 extends T1591uc9_1 {
    Object o1 = new T1591uc9_1.Inner();
    Object o2 = new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-unqualified-concrete-10
The ClassOrInterfaceType must be accessible

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-10 { The ClassOrInterfaceType must
        be accessible } {
    
    compile [saveas T1591uc10_1.java {
class T1591uc10_1 {
    private class Inner{}
}
class T1591uc10_2 extends T1591uc10_1 {
    Object o1 = new T1591uc10_1.Inner();
    Object o2 = new Inner();
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-11
Interface instances cannot be created

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-11 { Interface instances cannot be
        created } {
    
    compile [saveas T1591uc11.java {
interface I1591uc11 {}
class T1591uc11 {
    Object o = new I1591uc11();
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-12
Concrete classes may be final

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-12 { Concrete classes may be final } {
    
    empty_class T1591uc12 {
        final class Inner{}
        Object o1 = new T1591uc12.Inner();
        Object o2 = new Inner();
    }

} {PASS}
Test Case: 15.9.1-unqualified-concrete-13
Concrete classes may not be abstract

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-13 { Concrete classes may not be
        abstract } {
    
    empty_class T1591uc13 {
        abstract class Inner{}
        Object o1 = new T1591uc13.Inner();
        Object o2 = new Inner();
    }

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-14
The name may not be ambiguous, Inner is ambiguous, even though one is an inner class and cannot be constructed without an enclosing instance

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-14 { The name may not be ambiguous,
        Inner is ambiguous, even though one is an inner class and
        cannot be constructed without an enclosing instance } {
    
    compile [saveas T1591uc14_1.java {
class T1591uc14_1 {
    class Inner{}
}
interface T1591uc14_2 {
    class Inner{}
}
class T1591uc14_3 extends T1591uc14_1 implements T1591uc14_2 {
    static Object o = new T1591uc14_3.Inner();
}
    }]

} {FAIL}
Test Case: 15.9.1-unqualified-concrete-15
The name may not be ambiguous, accessibility means that only one Inner is inherited

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-unqualified-concrete-15 { The name may not be ambiguous,
        accessibility means that only one Inner is inherited } {
    
    compile [saveas p1/T1591uc15_1.java {
package p1;
public class T1591uc15_1 {
    static class Inner{}
}
    }] [saveas p2/T1591uc15_2.java {
package p2;
import p1.*;
interface T1591uc15_2 {
    class Inner{}
}
class T1591uc15_3 extends T1591uc15_1 implements T1591uc15_2 {
    static Object o = new T1591uc15_3.Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-concrete-1
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-concrete-1 { The simple name must be an
        accessible inner class of the qualifier } {
    
    empty_class T1591qc1 {
        class Inner{}
        Object o = new T1591qc1().new Inner();
    }

} {PASS}
Test Case: 15.9.1-qualified-concrete-2
Concrete classes may be final

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-concrete-2 { Concrete classes may be final } {
    
    empty_class T1591qc2 {
        final class Inner{}
        Object o = new T1591qc2().new Inner();
    }

} {PASS}
Test Case: 15.9.1-qualified-concrete-3
Concrete classes may not be abstract

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-3 { Concrete classes may not be
        abstract } {
    
    empty_class T1591qc3 {
        abstract class Inner{}
        Object o = new T1591qc3().new Inner();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-4
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-concrete-4 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qc4_1.java {
package p1;
public class T1591qc4_1 {
    public class Inner{}
}
    }] [saveas p2/T1591qc4_2.java {
package p2;
import p1.*;
class T1591qc4_2 extends p1.T1591qc4_1 {
    Object o = new p1.T1591qc4_1().new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-concrete-5
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-concrete-5 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qc5_1.java {
package p1;
public class T1591qc5_1 {
    protected class Inner{
        public Inner(){}
    }
}
    }] [saveas p2/T1591qc5_2.java {
package p2;
import p1.*;
class T1591qc5_2 extends p1.T1591qc5_1 {
    Object o = new p1.T1591qc5_1().new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-concrete-6
The simple name must be an accessible inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-6 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qc6_1.java {
package p1;
public class T1591qc6_1 {
    class Inner{}
}
    }] [saveas p2/T1591qc6_2.java {
package p2;
import p1.*;
class T1591qc6_2 extends p1.T1591qc6_1 {
    Object o = new p1.T1591qc6_1().new Inner();
}
    }]

} {FAIL}
Test Case: 15.9.1-qualified-concrete-7
The simple name must be an accessible inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-7 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas p1/T1591qc7_1.java {
package p1;
public class T1591qc7_1 {
    private class Inner{}
}
    }] [saveas p2/T1591qc7_2.java {
package p2;
import p1.*;
class T1591qc7_2 extends p1.T1591qc7_1 {
    Object o = new p1.T1591qc7_1().new Inner();
}
    }]

} {FAIL}
Test Case: 15.9.1-qualified-concrete-8
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-concrete-8 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas T1591qc8_1.java {
class T1591qc8_1 {
    protected class Inner{}
}
class T1591qc8_2 extends T1591qc8_1 {
    Object o = new T1591qc8_1().new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-concrete-9
The simple name must be an accessible inner class of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-concrete-9 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas T1591qc9_1.java {
class T1591qc9_1 {
    class Inner{}
}
class T1591qc9_2 extends T1591qc9_1 {
    Object o = new T1591qc9_1().new Inner();
}
    }]

} {PASS}
Test Case: 15.9.1-qualified-concrete-10
The simple name must be an accessible inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-10 { The simple name must be an
        accessible inner class of the qualifier } {
    
    compile [saveas T1591qc10_1.java {
class T1591qc10_1 {
    private class Inner{}
}
class T1591qc10_2 extends T1591qc10_1 {
    Object o = new T1591qc10_1().new Inner();
}
    }]

} {FAIL}
Test Case: 15.9.1-qualified-concrete-11
The qualified name must be simple

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-11 { The qualified name must be simple } {
    
    empty_class T1591qc11 {
        class Inner{}
        Object o = new T1591qc11().new T1591qc11.Inner();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-12
The qualified name must be an inner class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-12 { The qualified name must be an
        inner class } {
    
    empty_class T1591qc12 {
        static class Inner{}
        Object o = new T1591qc12().new Inner();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-13
The qualified name must be an inner class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-13 { The qualified name must be an
        inner class } {
    
    empty_class T1591qc13 {
        interface Inner{}
        Object o = new T1591qc13().new Inner();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-14
The qualified name must be an inner class

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-14 { The qualified name must be an
        inner class } {
    
    empty_class T1591qc13 {
        Object o = new T1591qc13().new Object();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-15
The concrete class extends the inner class of the type of the qualifier

Expected Result: PASS

Regression Test:

tcltest::test 15.9.1-qualified-concrete-15 { The concrete class extends
        the inner class of the type of the qualifier } {
    
    empty_class T1591qc15 {
        Object o = new T1591qc15(){
            class Inner{}
        }.new Inner();
    }

} {PASS}
Test Case: 15.9.1-qualified-concrete-16
The name may not be ambiguous, Inner is ambiguous, even though only one is an inner class member classes of interfaces are static, and do not have enclosing instance

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-16 { The name may not be ambiguous,
         Inner is ambiguous, even though only one is an inner class member
         classes of interfaces are static, and do not have enclosing instance } {
    
    compile [saveas T1591qc16_1.java {
class T1591qc16_1 {
    class Inner{}
}
interface T1591qc16_2 {
    class Inner{}
}
class T1591qc16_3 extends T1591qc16_1 implements T1591qc16_2 {
    Object o = new T1591qc16_3().new Inner();
}
n    }]

} {FAIL}
Test Case: 15.9.1-qualified-concrete-17
The qualifier must be a reference

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-17 { The qualifier must be a reference } {
    
    empty_class T1591qc17 {
        class Inner{}
        int foo() { return 1; }
        Object o = foo().new Inner();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-18
The qualifier must be a reference

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-18 { The qualifier must be a reference } {
    
    empty_class T1591qc18 {
        class Inner{}
        Object o = null.new Inner();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-19
The qualifier must be a reference

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-19 { The qualifier must be a reference } {
    
    empty_class T1591qc19 {
        class Inner{}
        Object o = System.out.println().new Inner();
    }

} {FAIL}
Test Case: 15.9.1-qualified-concrete-20
The qualified name must be an inner class of the qualifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.9.1-qualified-concrete-20 { The qualified name must be an
        inner class of the qualifier } {
    
    compile [saveas T1591qa20_1.java {
class T1591qa20_1 {}
class T1591qa20_2 extends T1591qa20_1 {
    class Inner{}
    Object o = new T1591qa20_1().new Inner();
}
    }]

} {FAIL}

15.10

Directory : tests/jls/expressions/array-creation-expressions


Test Case: 15.10-initializer-syntax-1
array initializer may be empty

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-syntax-1 { array initializer may be empty } {
    
    empty_main T1510is1 {
        int[] ia = new int[] {};
    }

} {PASS}
Test Case: 15.10-initializer-syntax-2
array initializer may contain initializers

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-syntax-2 { array initializer may contain
        initializers } {
    
    empty_main T1510is2 {
        int[] ia = new int[] { 1 };
    }

} {PASS}
Test Case: 15.10-initializer-syntax-3
array initializer may contain initializers

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-syntax-3 { array initializer may contain
        initializers } {
    
    empty_main T1510is3 {
        int[] ia = new int[] { 1, 2 };
    }

} {PASS}
Test Case: 15.10-initializer-syntax-4
array initializer may contain concluding comma

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-syntax-4 { array initializer may contain
        concluding comma } {
    
    empty_main T1510is4 {
        int[] ia = new int[] { , };
    }

} {PASS}
Test Case: 15.10-initializer-syntax-5
array initializer may contain concluding comma

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-syntax-5 { array initializer may contain
        concluding comma } {
    
    empty_main T1510is5 {
        int[] ia = new int[] { 1, };
    }

} {PASS}
Test Case: 15.10-initializer-syntax-6
array initializers may nest

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-syntax-6 { array initializers may nest } {
    
    empty_main T1510ii6 {
        int[][] iaa = new int[][] { {1}, {2} };
    }

} {PASS}
Test Case: 15.10-initializer-type-1
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-type-1 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it1 {
        short s = 1;
        int[] ia = new int[] { s, '1' };
    }

} {PASS}
Test Case: 15.10-initializer-type-2
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-2 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it2 {
        int[] ia = new int[] { 1L };
    }

} {FAIL}
Test Case: 15.10-initializer-type-3
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-3 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it3 {
        int[] ia = new int[] { new Object() };
    }

} {FAIL}
Test Case: 15.10-initializer-type-4
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-4 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it4 {
        int[] ia = new int[] { null };
    }

} {FAIL}
Test Case: 15.10-initializer-type-5
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-5 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it5 {
        int[] ia = new int[] { System.out.println() };
    }

} {FAIL}
Test Case: 15.10-initializer-type-6
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-6 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it6 {
        Object[] oa = new Object[] { 1 };
    }

} {FAIL}
Test Case: 15.10-initializer-type-7
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-type-7 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it7 {
        Object[] oa = new Object[] { new Object() };
    }

} {PASS}
Test Case: 15.10-initializer-type-8
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-type-8 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it8 {
        Object[] oa = new Object[] { null };
    }

} {PASS}
Test Case: 15.10-initializer-type-9
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-9 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it9 {
        Object[] oa = new Object[] { System.out.println() };
    }

} {FAIL}
Test Case: 15.10-initializer-type-10
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-type-10 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it10 {
        int[][] iaa = new int[][] { {1} };
    }

} {PASS}
Test Case: 15.10-initializer-type-11
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-11 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it11 {
        int[][] iaa = new int[][] { 1 };
    }

} {FAIL}
Test Case: 15.10-initializer-type-12
expressions in array initializer must be assignment compatible with array type

Expected Result: FAIL

Regression Test:

tcltest::test 15.10-initializer-type-12 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it12 {
        int[][] iaa = new int[][] { { {1} } };
    }

} {FAIL}
Test Case: 15.10-initializer-type-13
expressions in array initializer must be assignment compatible with array type

Expected Result: PASS

Regression Test:

tcltest::test 15.10-initializer-type-13 { expressions in array initializer
        must be assignment compatible with array type } {
    
    empty_main T1510it13 {
        int[][] iaa = new int[][] { {1, 2}, null };
    }

} {PASS}

15.12.2.1

Directory : tests/jls/expressions/method-invocation-expressions/determine-method-signature/applicable-and-accessible


Test Case: 15.12.2.1-jls-example-1
example code, should fail since two(int) is private

Expected Result: FAIL

Regression Test:

tcltest::test 15.12.2.1-jls-example-1 { example code,
        should fail since two(int) is private } {
    

    saveas T151221je1.java {
class Doubler {
    static int two() { return two(1); }
    private static int two(int i) { return 2*i; }
}
class Test extends Doubler {    
    public static long two(long j) {return j+j; }
    public static void main(String[] args) {
        System.out.println(two(3));
        System.out.println(Doubler.two(3)); // compile-time error
    }
}
}

   compile T151221je1.java

} {FAIL}
Test Case: 15.12.2.1-jls-example-2
example code, The type of the literal 37 is int, and int cannot be converted to byte by method invocation conversion

Expected Result: FAIL

Regression Test:

tcltest::test 15.12.2.1-jls-example-2 { example code,
         The type of the literal 37 is int, and int
         cannot be converted to byte by method invocation
         conversion } {
    

    saveas T151221je2.java {
class ColoredPoint {
    int x, y;
    byte color;
    void setColor(byte color) { this.color = color; }
}
class Test {
    public static void main(String[] args) {
        ColoredPoint cp = new ColoredPoint();
        byte color = 37;
        cp.setColor(color);
        cp.setColor(37);  // compile-time error
    }
}
}
    compile T151221je2.java

} {FAIL}
Test Case: 15.12.2.1-accessibility-constructor-1
A constructor must be applicable and accessible, in this case the constructor is private so it is not accessible even though it is applicable

Expected Result: PASS

Regression Test:

tcltest::test 15.12.2.1-accessibility-constructor-1 {
        A constructor must be applicable and accessible,
        in this case the constructor is private so it
        is not accessible even though it is applicable } {
    
    saveas T151221ac1.java {
class T151221ac1 {
    public T151221ac1(String s) {}
    private T151221ac1(Integer i) {}
}
class T151221ac1_Test {
    Object o = new T151221ac1(null);
}
}

    compile T151221ac1.java

} {PASS}
Test Case: 15.12.2.1-accessibility-constructor-2
A private constructor is not accessible

Expected Result: PASS

Regression Test:

tcltest::test 15.12.2.1-accessibility-constructor-2 {
        A private constructor is not accessible } {
    

    saveas T151221ac2.java {
class T151221ac2 {
    public T151221ac2(String x, String y) {}
    private T151221ac2(String x, char[] y) {}
}
class T151221ac2_Test {
    Object o = new T151221ac2("hi", null);
}
}

    compile T151221ac2.java

} {PASS}
Test Case: 15.12.2.1-accessibility-method-1
A method must be applicable and accessible, in this case the method is private so it is not accessible even though it is applicable

Expected Result: PASS

Regression Test:

tcltest::test 15.12.2.1-accessibility-method-1 {
        A method must be applicable and accessible,
        in this case the method is private so it
        is not accessible even though it is applicable } {
    

    saveas T151221am1.java {
class T151221am1 {
    public int foo(String s) { return 0; }
    private int foo(Integer i) { return 0; }
}
class T151221am1_Test {
    int i = new T151221am1().foo(null);
}
}

    compile T151221am1.java

} {PASS}

15.14.1

Directory : tests/jls/expressions/postfix-expressions/postfix-increment-operator


Test Case: 15.14.1-argument-1
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-1 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a1 {int i = 1++;}

} {FAIL}
Test Case: 15.14.1-argument-2
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-2 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a2 {boolean b = true++;}

} {FAIL}
Test Case: 15.14.1-argument-3
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-3 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a3 {Object o = null++;}

} {FAIL}
Test Case: 15.14.1-argument-4
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-4 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a4 {Object o = (new Object())++;}

} {FAIL}
Test Case: 15.14.1-argument-5
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-5 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a5 {int i = (System.out.println())++;}

} {FAIL}
Test Case: 15.14.1-argument-6
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-6 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a6 {boolean b = true, b2 = b++;}

} {FAIL}
Test Case: 15.14.1-argument-7
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-7 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a7 {Object o = null, o2 = o++;}

} {FAIL}
Test Case: 15.14.1-argument-8
Postfix++ must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-8 { Postfix++ must operate on a numeric variable } {
    
    empty_class T15141a8 {int i = 1, i2 = (-i)++;}

} {FAIL}
Test Case: 15.14.1-argument-9
Postfix++ cannot operate on final variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-argument-9 { Postfix++ cannot operate on final variable } {
    
    empty_class T15141a9 {final int i = 1, j = i++;}

} {FAIL}
Test Case: 15.14.1-type-1
Postfix++ operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.1-type-1 { Postfix++ operates on all numeric types } {
    
    empty_class T15141t1 {byte b = 1, b2 = b++;}

} {PASS}
Test Case: 15.14.1-type-2
Postfix++ operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.1-type-2 { Postfix++ operates on all numeric types } {
    
    empty_class T15141t2 {short s = 1, s2 = s++;}

} {PASS}
Test Case: 15.14.1-type-3
Postfix++ operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.1-type-3 { Postfix++ operates on all numeric types } {
    
    empty_class T15141t3 {char c = 1, c2 = c++;}

} {PASS}
Test Case: 15.14.1-type-4
Postfix++ operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.1-type-4 { Postfix++ operates on all numeric types } {
    
    empty_class T15141t4 {int i = 1, i2 = i++;}

} {PASS}
Test Case: 15.14.1-type-5
Postfix++ operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.1-type-5 { Postfix++ operates on all numeric types } {
    
    empty_class T15141t5 {long l = 1, l2 = l++;}

} {PASS}
Test Case: 15.14.1-type-6
Postfix++ operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.1-type-6 { Postfix++ operates on all numeric types } {
    
    empty_class T15141t6 {float f = 1, f2 = f++;}

} {PASS}
Test Case: 15.14.1-type-7
Postfix++ operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.1-type-7 { Postfix++ operates on all numeric types } {
    
    empty_class T15141t7 {double d = 1, d2 = d++;}

} {PASS}
Test Case: 15.14.1-result-1
Postfix++ results in a value, not a variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.1-result-1 { Postfix++ results in a value, not a variable } {
    
    empty_class T15141r1 {
void foo() {
    int i = 1;
    i++ = 2;
}   }

} {FAIL}

15.14.2

Directory : tests/jls/expressions/postfix-expressions/postfix-decrement-operator


Test Case: 15.14.2-argument-1
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-1 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a1 {int i = 1--;}

} {FAIL}
Test Case: 15.14.2-argument-2
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-2 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a2 {boolean b = true--;}

} {FAIL}
Test Case: 15.14.2-argument-3
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-3 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a3 {Object o = null--;}

} {FAIL}
Test Case: 15.14.2-argument-4
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-4 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a4 {Object o = (new Object())--;}

} {FAIL}
Test Case: 15.14.2-argument-5
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-5 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a5 {int i = (System.out.println())--;}

} {FAIL}
Test Case: 15.14.2-argument-6
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-6 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a6 {boolean b = true, b2 = b--;}

} {FAIL}
Test Case: 15.14.2-argument-7
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-7 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a7 {Object o = null, o2 = o--;}

} {FAIL}
Test Case: 15.14.2-argument-8
Postfix-- must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-8 { Postfix-- must operate on a numeric variable } {
    
    empty_class T15142a8 {int i = 1, i2 = (-i)--;}

} {FAIL}
Test Case: 15.14.2-argument-9
Postfix-- cannot operate on final variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-argument-9 { Postfix-- cannot operate on final variable } {
    
    empty_class T15142a9 {final int i = 1, j = i--;}

} {FAIL}
Test Case: 15.14.2-type-1
Postfix-- operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.2-type-1 { Postfix-- operates on all numeric types } {
    
    empty_class T15142t1 {byte b = 1, b2 = b--;}

} {PASS}
Test Case: 15.14.2-type-2
Postfix-- operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.2-type-2 { Postfix-- operates on all numeric types } {
    
    empty_class T15142t2 {short s = 1, s2 = s--;}

} {PASS}
Test Case: 15.14.2-type-3
Postfix-- operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.2-type-3 { Postfix-- operates on all numeric types } {
    
    empty_class T15142t3 {char c = 1, c2 = c--;}

} {PASS}
Test Case: 15.14.2-type-4
Postfix-- operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.2-type-4 { Postfix-- operates on all numeric types } {
    
    empty_class T15142t4 {int i = 1, i2 = i--;}

} {PASS}
Test Case: 15.14.2-type-5
Postfix-- operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.2-type-5 { Postfix-- operates on all numeric types } {
    
    empty_class T15142t5 {long l = 1, l2 = l--;}

} {PASS}
Test Case: 15.14.2-type-6
Postfix-- operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.2-type-6 { Postfix-- operates on all numeric types } {
    
    empty_class T15142t6 {float f = 1, f2 = f--;}

} {PASS}
Test Case: 15.14.2-type-7
Postfix-- operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.14.2-type-7 { Postfix-- operates on all numeric types } {
    
    empty_class T15142t7 {double d = 1, d2 = d--;}

} {PASS}
Test Case: 15.14.2-result-1
Postfix-- results in a value, not a variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.14.2-result-1 { Postfix-- results in a value, not a variable } {
    
    empty_class T15142r1 {
void foo() {
    int i = 1;
    i-- = 2;
}   }

} {FAIL}

15.15

Directory : tests/jls/expressions/unary-operators


Test Case: 15.15-group-1
Unary operators group right-to-left

Expected Result: PASS

Regression Test:

tcltest::test 15.15-group-1 { Unary operators group right-to-left } {
    
    constant_expression T15151 {-~0xffffffff == 0}  {~-0xffffffff == 0xfffffffe}

} {PASS}
Test Case: 15.15-precedence-1
Unary operators have higher precedence than multiplicative

Expected Result: FAIL

Regression Test:

tcltest::test 15.15-precedence-1 { Unary operators have higher
        precedence than multiplicative } {
    
    is_assignable_to T1515p1 float {(float) 1/1.0}

} {FAIL}
Test Case: 15.15-precedence-2
Unary operators have higher precedence than multiplicative

Expected Result: PASS

Regression Test:

tcltest::test 15.15-precedence-2 { Unary operators have higher
        precedence than multiplicative } {
    
    is_assignable_to T1515p2 float {(float) (1/1.0)}

} {PASS}
Test Case: 15.15-precedence-3
Unary operators have higher precedence than multiplicative

Expected Result: PASS

Regression Test:

tcltest::test 15.15-precedence-3 { Unary operators have higher
        precedence than multiplicative } {
    
    constant_expression T1515p3 {-0x80000000/2 == 0xc0000000}  {-(0x80000000/2) == 0x40000000}

} {PASS}
Test Case: 15.15-precedence-4
Unary operators have higher precedence than multiplicative

Expected Result: PASS

Regression Test:

tcltest::test 15.15-precedence-4 { Unary operators have higher
        precedence than multiplicative } {
    
    constant_expression T1515p4 {~0xffffffff*2 == 0}  {~(0xffffffff*2) == 1}

} {PASS}
Test Case: 15.15-precedence-5
Unary operators have higher precedence than addition, for boolean

Expected Result: PASS

Regression Test:

tcltest::test 15.15-precedence-5 { Unary operators have higher
        precedence than addition, for boolean } {
    
    constant_expression T1515p5 {!true + "" == "false"}

} {PASS}

15.15.1

Directory : tests/jls/expressions/unary-operators/prefix-increment-operator


Test Case: 15.15.1-argument-1
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-1 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a1 {int i = ++1;}

} {FAIL}
Test Case: 15.15.1-argument-2
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-2 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a2 {boolean b = ++true;}

} {FAIL}
Test Case: 15.15.1-argument-3
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-3 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a3 {Object o = ++null;}

} {FAIL}
Test Case: 15.15.1-argument-4
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-4 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a4 {Object o = ++(new Object());}

} {FAIL}
Test Case: 15.15.1-argument-5
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-5 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a5 {int i = ++(System.out.println());}

} {FAIL}
Test Case: 15.15.1-argument-6
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-6 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a6 {boolean b = true, b2 = ++b;}

} {FAIL}
Test Case: 15.15.1-argument-7
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-7 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a7 {Object o = null, o2 = ++o;}

} {FAIL}
Test Case: 15.15.1-argument-8
++Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-8 { ++Prefix must operate on a numeric variable } {
    
    empty_class T15151a8 {int i = 1, i2 = ++(-i);}

} {FAIL}
Test Case: 15.15.1-argument-9
++Prefix cannot operate on final variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-argument-9 { ++Prefix cannot operate on final variable } {
    
    empty_class T15151a9 {final int i = 1, j = ++i;}

} {FAIL}
Test Case: 15.15.1-type-1
++Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.1-type-1 { ++Prefix operates on all numeric types } {
    
    empty_class T15151t1 {byte b = 1, b2 = ++b;}

} {PASS}
Test Case: 15.15.1-type-2
++Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.1-type-2 { ++Prefix operates on all numeric types } {
    
    empty_class T15151t2 {short s = 1, s2 = ++s;}

} {PASS}
Test Case: 15.15.1-type-3
++Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.1-type-3 { ++Prefix operates on all numeric types } {
    
    empty_class T15151t3 {char c = 1, c2 = ++c;}

} {PASS}
Test Case: 15.15.1-type-4
++Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.1-type-4 { ++Prefix operates on all numeric types } {
    
    empty_class T15151t4 {int i = 1, i2 = ++i;}

} {PASS}
Test Case: 15.15.1-type-5
++Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.1-type-5 { ++Prefix operates on all numeric types } {
    
    empty_class T15151t5 {long l = 1, l2 = ++l;}

} {PASS}
Test Case: 15.15.1-type-6
++Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.1-type-6 { ++Prefix operates on all numeric types } {
    
    empty_class T15151t6 {float f = 1, f2 = ++f;}

} {PASS}
Test Case: 15.15.1-type-7
++Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.1-type-7 { ++Prefix operates on all numeric types } {
    
    empty_class T15151t7 {double d = 1, d2 = ++d;}

} {PASS}
Test Case: 15.15.1-result-1
++Prefix results in a value, not a variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.1-result-1 { ++Prefix results in a value, not a variable } {
    
    empty_class T15151r1 {
void foo() {
    int i = 1;
    ++i = 2;
}   }

} {FAIL}

15.15.2

Directory : tests/jls/expressions/unary-operators/prefix-decrement-operator


Test Case: 15.15.2-argument-1
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-1 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a1 {int i = --1;}

} {FAIL}
Test Case: 15.15.2-argument-2
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-2 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a2 {boolean b = --true;}

} {FAIL}
Test Case: 15.15.2-argument-3
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-3 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a3 {Object o = --null;}

} {FAIL}
Test Case: 15.15.2-argument-4
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-4 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a4 {Object o = --(new Object());}

} {FAIL}
Test Case: 15.15.2-argument-5
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-5 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a5 {int i = --(System.out.println());}

} {FAIL}
Test Case: 15.15.2-argument-6
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-6 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a6 {boolean b = true, b2 = --b;}

} {FAIL}
Test Case: 15.15.2-argument-7
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-7 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a7 {Object o = null, o2 = --o;}

} {FAIL}
Test Case: 15.15.2-argument-8
--Prefix must operate on a numeric variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-8 { --Prefix must operate on a numeric variable } {
    
    empty_class T15152a8 {int i = 1, i2 = --(-i);}

} {FAIL}
Test Case: 15.15.2-argument-9
--Prefix cannot operate on final variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-argument-9 { --Prefix cannot operate on final variable } {
    
    empty_class T15152a9 {final int i = 1, j = --i;}

} {FAIL}
Test Case: 15.15.2-type-1
--Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.2-type-1 { --Prefix operates on all numeric types } {
    
    empty_class T15152t1 {byte b = 1, b2 = --b;}

} {PASS}
Test Case: 15.15.2-type-2
--Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.2-type-2 { --Prefix operates on all numeric types } {
    
    empty_class T15152t2 {short s = 1, s2 = --s;}

} {PASS}
Test Case: 15.15.2-type-3
--Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.2-type-3 { --Prefix operates on all numeric types } {
    
    empty_class T15152t3 {char c = 1, c2 = --c;}

} {PASS}
Test Case: 15.15.2-type-4
--Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.2-type-4 { --Prefix operates on all numeric types } {
    
    empty_class T15152t4 {int i = 1, i2 = --i;}

} {PASS}
Test Case: 15.15.2-type-5
--Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.2-type-5 { --Prefix operates on all numeric types } {
    
    empty_class T15152t5 {long l = 1, l2 = --l;}

} {PASS}
Test Case: 15.15.2-type-6
--Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.2-type-6 { --Prefix operates on all numeric types } {
    
    empty_class T15152t6 {float f = 1, f2 = --f;}

} {PASS}
Test Case: 15.15.2-type-7
--Prefix operates on all numeric types

Expected Result: PASS

Regression Test:

tcltest::test 15.15.2-type-7 { --Prefix operates on all numeric types } {
    
    empty_class T15152t7 {double d = 1, d2 = --d;}

} {PASS}
Test Case: 15.15.2-result-1
--Prefix results in a value, not a variable

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.2-result-1 { --Prefix results in a value, not a variable } {
    
    empty_class T15152r1 {
void foo() {
    int i = 1;
    --i = 2;
}   }

} {FAIL}

15.15.3

Directory : tests/jls/expressions/unary-operators/unary-plus-operator


Test Case: 15.15.3-type-1
+ must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.3-type-1 { + must have numeric operand } {
    
    is_assignable_to T15153t1 Object +null

} {FAIL}
Test Case: 15.15.3-type-2
+ must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.3-type-2 { + must have numeric operand } {
    
    is_assignable_to T15153t2 boolean +true

} {FAIL}
Test Case: 15.15.3-type-3
+ must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.3-type-3 { + must have numeric operand } {
    
    is_assignable_to T15153t3 Object {+(new Object())}

} {FAIL}
Test Case: 15.15.3-type-4
+ must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.3-type-4 { + must have numeric operand } {
    
    is_assignable_to T15153t4 int +System.out.println()

} {FAIL}
Test Case: 15.15.3-type-5
+ performs unary promotion

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.3-type-5 { + performs unary promotion } {
    
#is_assignable_to creates byte n1, byte n2
    is_assignable_to T15153t5 byte 1 byte +n1

} {FAIL}
Test Case: 15.15.3-type-6
+ must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.3-type-6 { + must have numeric operand } {
    
    is_assignable_to T15153t6 int +1

} {PASS}
Test Case: 15.15.3-type-7
+ must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.3-type-7 { + must have numeric operand } {
    
    is_assignable_to T15153t7 long +1L

} {PASS}
Test Case: 15.15.3-type-8
+ must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.3-type-8 { + must have numeric operand } {
    
    is_assignable_to T15153t8 float +1f

} {PASS}
Test Case: 15.15.3-type-9
+ must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.3-type-9 { + must have numeric operand } {
    
    is_assignable_to T15153t9 double +1d

} {PASS}
Test Case: 15.15.3-type-10
+ must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.3-type-10 { + must have numeric operand } {
    
    is_assignable_to T15153t10 short +1

} {PASS}
Test Case: 15.15.3-type-11
+ must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.3-type-11 { + must have numeric operand } {
    
    is_assignable_to T15153t11 char +'1'

} {PASS}
Test Case: 15.15.3-type-12
+ must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.3-type-12 { + must have numeric operand } {
    
    is_assignable_to T15153t12 byte +1

} {PASS}

15.15.4

Directory : tests/jls/expressions/unary-operators/unary-minus-operator


Test Case: 15.15.4-type-1
- must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.4-type-1 { - must have numeric operand } {
    
    is_assignable_to T15154t1 Object -null

} {FAIL}
Test Case: 15.15.4-type-2
- must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.4-type-2 { - must have numeric operand } {
    
    is_assignable_to T15154t2 boolean -true

} {FAIL}
Test Case: 15.15.4-type-3
- must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.4-type-3 { - must have numeric operand } {
    
    is_assignable_to T15154t3 Object {-(new Object())}

} {FAIL}
Test Case: 15.15.4-type-4
- must have numeric operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.4-type-4 { - must have numeric operand } {
    
    is_assignable_to T15154t4 int -System.out.println()

} {FAIL}
Test Case: 15.15.4-type-5
- performs unary promotion

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.4-type-5 { - performs unary promotion } {
    
#is_assignable_to creates byte n1, byte n2
    is_assignable_to T15154t5 byte 1 byte -n1

} {FAIL}
Test Case: 15.15.4-type-6
- must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-type-6 { - must have numeric operand } {
    
    is_assignable_to T15154t6 short -1

} {PASS}
Test Case: 15.15.4-type-7
- must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-type-7 { - must have numeric operand } {
    
    is_assignable_to T15154t7 char -(-'1')

} {PASS}
Test Case: 15.15.4-type-8
- must have numeric operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-type-8 { - must have numeric operand } {
    
    is_assignable_to T15154t8 byte -1

} {PASS}
Test Case: 15.15.4-int-1
-x = ~x+1 for all ints

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-int-1 { -x = ~x+1 for all ints } {
    
    constant_expression T15154i1 {-0 == ~0+1}

} {PASS}
Test Case: 15.15.4-int-2
-x = ~x+1 for all ints

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-int-2 { -x = ~x+1 for all ints } {
    
    constant_expression T15154i2 {-0xffffffff == ~0xffffffff+1}

} {PASS}
Test Case: 15.15.4-int-3
-MIN_INT is still MIN_INT

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-int-3 { -MIN_INT is still MIN_INT } {
    
    constant_expression T15154i3 {-0x80000000 == 0x80000000}

} {PASS}
Test Case: 15.15.4-long-1
-x = ~x+1 for all longs

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-long-1 { -x = ~x+1 for all longs } {
    
    constant_expression T15154l1 {-0L == ~0L+1}

} {PASS}
Test Case: 15.15.4-long-2
-x = ~x+1 for all longs

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-long-2 { -x = ~x+1 for all longs } {
    
    constant_expression T15154l2 {-0xffffffffffffffffL == ~0xffffffffffffffffL+1}

} {PASS}
Test Case: 15.15.4-long-3
-MIN_LONG is still MIN_LONG

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-long-3 { -MIN_LONG is still MIN_LONG } {
    
    constant_expression T15154l3 {-0x8000000000000000L == 0x8000000000000000L}

} {PASS}
Test Case: 15.15.4-float-1
-NaN is still NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-float-1 { -NaN is still NaN } {
    
    constant_expression T15154f1 {-Float.NaN != -Float.NaN}

} {PASS}
Test Case: 15.15.4-float-2
- Infinity is Infinity of opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-float-2 { - Infinity is Infinity of opposite sign } {
    
    constant_expression T15154f2 {-Float.POSITIVE_INFINITY == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.15.4-float-3
- 0.0 is zero of opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-float-3 { - 0.0 is zero of opposite sign } {
    
    constant_expression T15154f3 {(1/0.0f) != (1/-0.0f)}

} {PASS}
Test Case: 15.15.4-double-1
-NaN is still NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-double-1 { -NaN is still NaN } {
    
    constant_expression T15154d1 {-Double.NaN != -Double.NaN}

} {PASS}
Test Case: 15.15.4-double-2
- Infinity is Infinity of opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-double-2 { - Infinity is Infinity of opposite sign } {
    
    constant_expression T15154d2 {-Double.POSITIVE_INFINITY == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.15.4-double-3
- 0.0 is zero of opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.15.4-double-3 { - 0.0 is zero of opposite sign } {
    
    constant_expression T15154d3 {(1/0.0) != (1/-0.0)}

} {PASS}

15.15.5

Directory : tests/jls/expressions/unary-operators/bitwise-complement-operator


Test Case: 15.15.5-type-1
~ must have integral operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.5-type-1 { ~ must have integral operand } {
    
    is_assignable_to T15155t1 Object ~null

} {FAIL}
Test Case: 15.15.5-type-2
~ must have integral operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.5-type-2 { ~ must have integral operand } {
    
    is_assignable_to T15155t2 boolean ~true

} {FAIL}
Test Case: 15.15.5-type-3
~ must have integral operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.5-type-3 { ~ must have integral operand } {
    
    is_assignable_to T15155t3 Object {~(new Object())}

} {FAIL}
Test Case: 15.15.5-type-4
~ must have integral operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.5-type-4 { ~ must have integral operand } {
    
    is_assignable_to T15155t4 int ~System.out.println()

} {FAIL}
Test Case: 15.15.5-type-5
~ must have integral operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.5-type-5 { ~ must have integral operand } {
    
    is_assignable_to T15155t5 int ~0.0f

} {FAIL}
Test Case: 15.15.5-type-6
~ must have integral operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.5-type-6 { ~ must have integral operand } {
    
    is_assignable_to T15155t6 int ~0.0d

} {FAIL}
Test Case: 15.15.5-type-7
~ performs unary promotion

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.5-type-7 { ~ performs unary promotion } {
    
#is_assignable_to creates byte n1, byte n2
    is_assignable_to T15155t7 byte 1 byte ~n1

} {FAIL}
Test Case: 15.15.5-type-8
~ must have integral operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.5-type-8 { ~ must have integral operand } {
    
    is_assignable_to T15155t8 short ~1

} {PASS}
Test Case: 15.15.5-type-9
~ must have integral operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.5-type-9 { ~ must have integral operand } {
    
    is_assignable_to T15155t9 char ~(~'1')

} {PASS}
Test Case: 15.15.5-type-10
~ must have integral operand

Expected Result: PASS

Regression Test:

tcltest::test 15.15.5-type-10 { ~ must have integral operand } {
    
    is_assignable_to T15155t10 byte ~1

} {PASS}
Test Case: 15.15.5-int-1
~x = -x-1 for all ints

Expected Result: PASS

Regression Test:

tcltest::test 15.15.5-int-1 { ~x = -x-1 for all ints } {
    
    constant_expression T15155i1 {~0 == -0-1}

} {PASS}
Test Case: 15.15.5-int-2
~x = -x-1 for all ints

Expected Result: PASS

Regression Test:

tcltest::test 15.15.5-int-2 { ~x = -x-1 for all ints } {
    
    constant_expression T15155i2 {~0xffffffff == -0xffffffff-1}

} {PASS}
Test Case: 15.15.5-long-1
~x = -x-1 for all longs

Expected Result: PASS

Regression Test:

tcltest::test 15.15.5-long-1 { ~x = -x-1 for all longs } {
    
    constant_expression T15155l1 {~0L == -0L-1}

} {PASS}
Test Case: 15.15.5-long-2
~x = -x-1 for all longs

Expected Result: PASS

Regression Test:

tcltest::test 15.15.5-long-2 { ~x = -x-1 for all longs } {
    
    constant_expression T15155l2 {~0xffffffffffffffffL == -0xffffffffffffffffL-1}

} {PASS}

15.15.6

Directory : tests/jls/expressions/unary-operators/logical-complement-operator


Test Case: 15.15.6-type-1
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-1 { ! must have boolean operand } {
    
    is_assignable_to T15156t1 Object !null

} {FAIL}
Test Case: 15.15.6-type-2
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-2 { ! must have boolean operand } {
    
    is_assignable_to T15156t2 Object {!(new Object())}

} {FAIL}
Test Case: 15.15.6-type-3
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-3 { ! must have boolean operand } {
    
    is_assignable_to T15156t3 int !System.out.println()

} {FAIL}
Test Case: 15.15.6-type-4
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-4 { ! must have boolean operand } {
    
    is_assignable_to T15156t4 int !0.0f

} {FAIL}
Test Case: 15.15.6-type-5
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-5 { ! must have boolean operand } {
    
    is_assignable_to T15156t5 int !0.0d

} {FAIL}
Test Case: 15.15.6-type-6
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-6 { ! must have boolean operand } {
    
    is_assignable_to T15156t6 short !1

} {FAIL}
Test Case: 15.15.6-type-7
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-7 { ! must have boolean operand } {
    
    is_assignable_to T15156t7 char !'1'

} {FAIL}
Test Case: 15.15.6-type-8
! must have boolean operand

Expected Result: FAIL

Regression Test:

tcltest::test 15.15.6-type-8 { ! must have boolean operand } {
    
    is_assignable_to T15156t8 byte !1

} {FAIL}
Test Case: 15.15.6-boolean-1
! true is false

Expected Result: PASS

Regression Test:

tcltest::test 15.15.6-boolean-1 { ! true is false } {
    
    constant_expression T15156b1 {!true == false}

} {PASS}
Test Case: 15.15.6-boolean-2
! false is true

Expected Result: PASS

Regression Test:

tcltest::test 15.15.6-boolean-2 { ! false is true } {
    
    constant_expression T15156b2 {!false == true}

} {PASS}

15.17

Directory : tests/jls/expressions/multiplicative-operators


Test Case: 15.17-null-1
null is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-null-1 { null is not a primitive numeric type } {
    
    empty_class T1517null1 {int i = 2*null;}

} {FAIL}
Test Case: 15.17-null-2
null is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-null-2 { null is not a primitive numeric type } {
    
    empty_class T1517null2 {int i = 2/null;}

} {FAIL}
Test Case: 15.17-null-3
null is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-null-3 { null is not a primitive numeric type } {
    
    empty_class T1517null3 {int i = 2%null;}

} {FAIL}
Test Case: 15.17-boolean-1
boolean is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-boolean-1 { boolean is not a primitive numeric type } {
    
    empty_class T1517boolean1 {int i = 2*true;}

} {FAIL}
Test Case: 15.17-boolean-2
boolean is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-boolean-2 { boolean is not a primitive numeric type } {
    
    empty_class T1517boolean2 {int i = 2/true;}

} {FAIL}
Test Case: 15.17-boolean-3
boolean is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-boolean-3 { boolean is not a primitive numeric type } {
    
    empty_class T1517boolean3 {int i = 2%true;}

} {FAIL}
Test Case: 15.17-object-1
Object is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-object-1 { Object is not a primitive numeric type } {
    
    empty_class T1517object1 {int i = 2*(new Object());}

} {FAIL}
Test Case: 15.17-object-2
Object is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-object-2 { Object is not a primitive numeric type } {
    
    empty_class T1517object2 {int i = 2/(new Object());}

} {FAIL}
Test Case: 15.17-object-3
Object is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-object-3 { Object is not a primitive numeric type } {
    
    empty_class T1517object3 {int i = 2%(new Object());}

} {FAIL}
Test Case: 15.17-void-1
void is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-void-1 { void is not a primitive numeric type } {
    
    empty_class T1517void1 {int i = 2*System.out.println();}

} {FAIL}
Test Case: 15.17-void-2
void is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-void-2 { void is not a primitive numeric type } {
    
    empty_class T1517void2 {int i = 2/System.out.println();}

} {FAIL}
Test Case: 15.17-void-3
void is not a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-void-3 { void is not a primitive numeric type } {
    
    empty_class T1517void3 {int i = 2%System.out.println();}

} {FAIL}
Test Case: 15.17-mult-1
* is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mult-1 { * is a multiplicative operator } {
    
    constant_expression T1517mult1 {2*2 == 4}

} {PASS}
Test Case: 15.17-mult-2
* is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mult-2 { * is a multiplicative operator } {
    
    constant_expression T1517mult2 {2L*2L == 4L}

} {PASS}
Test Case: 15.17-mult-3
* is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mult-3 { * is a multiplicative operator } {
    
    constant_expression T1517mult3 {2.0F * 2.0F == 4.0F}

} {PASS}
Test Case: 15.17-mult-4
* is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mult-4 { * is a multiplicative operator } {
    
    constant_expression T1517mult4 {2.0D * 2.0D == 4.0D}

} {PASS}
Test Case: 15.17-div-1
/ is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-div-1 { / is a multiplicative operator } {
    
    constant_expression T1517div1 {2/2 == 1}

} {PASS}
Test Case: 15.17-div-2
/ is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-div-2 { / is a multiplicative operator } {
    
    constant_expression T1517div2 {2L/2L == 1L}

} {PASS}
Test Case: 15.17-div-3
/ is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-div-3 { / is a multiplicative operator } {
    
    constant_expression T1517div3 {2.0F / 2.0F == 1.0F}

} {PASS}
Test Case: 15.17-div-4
/ is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-div-4 { / is a multiplicative operator } {
    
    constant_expression T1517div4 {2.0D / 2.0D == 1.0D}

} {PASS}
Test Case: 15.17-mod-1
% is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mod-1 { % is a multiplicative operator } {
    
    constant_expression T1517mod1 {2%2 == 0}

} {PASS}
Test Case: 15.17-mod-2
% is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mod-2 { % is a multiplicative operator } {
    
    constant_expression T1517mod2 {2L%2L == 0L}

} {PASS}
Test Case: 15.17-mod-3
% is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mod-3 { % is a multiplicative operator } {
    
    constant_expression T1517mod3 {2.0F % 2.0F == 0.0F}

} {PASS}
Test Case: 15.17-mod-4
% is a multiplicative operator

Expected Result: PASS

Regression Test:

tcltest::test 15.17-mod-4 { % is a multiplicative operator } {
    
    constant_expression T1517mod4 {2.0D % 2.0D == 0.0D}

} {PASS}
Test Case: 15.17-type-1
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-1 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type1 int {1 * 2L}

} {FAIL}
Test Case: 15.17-type-2
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-2 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type2 long {1 * 2L}

} {PASS}
Test Case: 15.17-type-3
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-3 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type3 int {1 / 2L}

} {FAIL}
Test Case: 15.17-type-4
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-4 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type4 long {1 / 2L}

} {PASS}
Test Case: 15.17-type-5
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-5 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type5 int {1 % 2L}

} {FAIL}
Test Case: 15.17-type-6
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-6 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type6 long {1 % 2L}

} {PASS}
Test Case: 15.17-type-7
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-7 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type7 float {1f * 2D}

} {FAIL}
Test Case: 15.17-type-8
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-8 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type8 double {1f * 2D}

} {PASS}
Test Case: 15.17-type-9
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-9 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type9 float {1f / 2D}

} {FAIL}
Test Case: 15.17-type-10
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-10 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type10 double {1f / 2D}

} {PASS}
Test Case: 15.17-type-11
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-11 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type11 float {1f % 2D}

} {FAIL}
Test Case: 15.17-type-12
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-12 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type12 double {1f % 2D}

} {PASS}
Test Case: 15.17-type-13
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-13 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type13 int {1 * 2D}

} {FAIL}
Test Case: 15.17-type-14
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-14 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type14 double {1 * 2D}

} {PASS}
Test Case: 15.17-type-15
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-15 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type15 int {1 / 2D}

} {FAIL}
Test Case: 15.17-type-16
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-16 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type16 double {1 / 2D}

} {PASS}
Test Case: 15.17-type-17
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: FAIL

Regression Test:

tcltest::test 15.17-type-17 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type17 int {1 % 2D}

} {FAIL}
Test Case: 15.17-type-18
The type of a multiplicative expression is the promoted type of its operands.

Expected Result: PASS

Regression Test:

tcltest::test 15.17-type-18 { The type of a multiplicative
        expression is the promoted type of its operands. } {
    
    is_assignable_to T1517type18 double {1 % 2D}

} {PASS}

15.17.1

Directory : tests/jls/expressions/multiplicative-operators/multiplication-operator


Test Case: 15.17.1-commute-1
side-effect-free multiplication is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-commute-1 { side-effect-free multiplication is commutative } {
    
    constant_expression T15171commute1 {1 * 2 == 2 * 1}

} {PASS}
Test Case: 15.17.1-commute-2
side-effect-free multiplication is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-commute-2 { side-effect-free multiplication is commutative } {
    
    constant_expression T15171commute2 {1L * 2L == 2L * 1L}

} {PASS}
Test Case: 15.17.1-commute-3
side-effect-free multiplication is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-commute-3 { side-effect-free multiplication is commutative } {
    
    constant_expression T15171commute3 {1f * 2f == 2f * 1f}

} {PASS}
Test Case: 15.17.1-commute-4
side-effect-free multiplication is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-commute-4 { side-effect-free multiplication is commutative } {
    
    constant_expression T15171commute4 {1d * 2d == 2d * 1d}

} {PASS}
Test Case: 15.17.1-assoc-1
integer multiplication is associative when all arguments are of the same type

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-assoc-1 { integer multiplication is associative when
        all arguments are of the same type } {
    
    constant_expression T15171assoc1 {(1 * 2) * 3 == 1 * (2 * 3)}

} {PASS}
Test Case: 15.17.1-assoc-2
integer multiplication is not associative when arguments are of different types

Expected Result: FAIL

Regression Test:

tcltest::test 15.17.1-assoc-2 { integer multiplication is not associative
        when arguments are of different types } {
    
    constant_expression T15171assoc2  {(1L * 0x70000000) * 20 == 1L * (0x70000000 * 20)}

} {FAIL}
Test Case: 15.17.1-assoc-3
floating-point multiplication is not associative

Expected Result: FAIL

Regression Test:

tcltest::test 15.17.1-assoc-3 { floating-point multiplication is not associative } {
    
    constant_expression T15171assoc3  {(1e308 * 100.0) * .01 == 1e308 * (100.0 * .01)}

} {FAIL}
Test Case: 15.17.1-assoc-4
multiplication is left-associative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-assoc-4 { multiplication is left-associative } {
    
    constant_expression T15171assoc4  {1e308 * 100.0 * .01 == (1e308 * 100.0) * .01}

} {PASS}
Test Case: 15.17.1-float-1
NaN * NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-1 { NaN * NaN is NaN } {
    
    constant_expression T15171f1  {Float.NaN * Float.NaN != Float.NaN * Float.NaN}

} {PASS}
Test Case: 15.17.1-float-2
NaN * anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-2 { NaN * anything is NaN } {
    
    constant_expression T15171f2 {Float.NaN * 1f != Float.NaN * 1f}

} {PASS}
Test Case: 15.17.1-float-3
the result is positive in floating-point multiplication if both operands have the same sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-3 { the result is positive in floating-point
        multiplication if both operands have the same sign } {
    
    constant_expression T15171f3 {-1f * -2f > 0f} {1f * 2f > 0f}

} {PASS}
Test Case: 15.17.1-float-4
the result is negative in floating-point multiplication if the operands have opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-4 { the result is negative in floating-point
        multiplication if the operands have opposite sign } {
    
    constant_expression T15171f4 {-1f * 2f < 0f} {1f * -2f < 0f}

} {PASS}
Test Case: 15.17.1-float-5
Infinity * 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-5 { Infinity * 0 is NaN } {
    
    constant_expression T15171f5  {Float.POSITIVE_INFINITY * 0f != Float.POSITIVE_INFINITY * 0f}

} {PASS}
Test Case: 15.17.1-float-6
Infinity * finite == Infinity of correct sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-6 { Infinity * finite == Infinity of correct sign } {
    
    constant_expression T15171f6  {Float.NEGATIVE_INFINITY * -1f == Float.POSITIVE_INFINITY}  {Float.POSITIVE_INFINITY * -1f == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-float-7
Infinity * Infinity == Infinity of correct sign (Specified in JVMS errata)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-7 { Infinity * Infinity == Infinity of correct sign
        (Specified in JVMS errata) } {
    
    constant_expression T15171f7  {Float.NEGATIVE_INFINITY * Float.NEGATIVE_INFINITY == Float.POSITIVE_INFINITY}  {Float.POSITIVE_INFINITY * Float.POSITIVE_INFINITY == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-float-8
Infinity * Infinity == Infinity of correct sign (Specified in JVMS errata)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-8 { Infinity * Infinity == Infinity of correct sign
        (Specified in JVMS errata) } {
    
    constant_expression T15171f8  {Float.NEGATIVE_INFINITY * Float.POSITIVE_INFINITY == Float.NEGATIVE_INFINITY}  {Float.POSITIVE_INFINITY * Float.NEGATIVE_INFINITY == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-float-9
Floating-point * produces Infinity for overflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-9 { Floating-point * produces Infinity for overflow } {
    
    constant_expression T15171f9  {1.0e30f * 1.0e30f == Float.POSITIVE_INFINITY}  {1.0e30f * -1.0e30f == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-float-10
Floating-point * supports gradual underflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-10 { Floating-point * supports gradual underflow } {
    
    constant_expression T15171f10  {1e-22f * 1e-22f == 1e-44f}  {1e-22f * -1e-22f == -1e-44f}

} {PASS}
Test Case: 15.17.1-float-11
Floating-point * produces 0 for underflow (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-11 { Floating-point * produces 0 for underflow 
        (check 1/0 to determine sign) } {
    
    constant_expression T15171f11  {1e-30f * 1e-30f == 0}  {1/(1e-30f * 1e-30f) == Float.POSITIVE_INFINITY}  {1e-30f * -1e-30f == 0}  {1/(1e-30f * -1e-30f) == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-float-12
Floating-point * works even with denorms

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-12 { Floating-point * works even with denorms } {
    
    constant_expression T15171f12  {1e30f * 1e-40f == 9.999946e-11f}  {1e30f * -1e-40f == -9.999946e-11f}  {1e-40f * -1e30f == -9.999946e-11f}  {-1e-40f * -1e30f == 9.999946e-11f}

} {PASS}
Test Case: 15.17.1-float-13
Floating-point * follows round-to-nearest rules

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-13 { Floating-point * follows round-to-nearest rules } {
    
    constant_expression T15171f13  {0x800001 * 3f == 0x1800004}  {0x800001 * 5f == 0x2800004}  {0x800003 * 5f == 0x2800010}  {0x800002 * 5f == 0x2800008}

} {PASS}
Test Case: 15.17.1-float-14
Floating-point * follows round-to-nearest, even with denorms

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-float-14 { Floating-point * follows round-to-nearest,
        even with denorms } {
    
    constant_expression T15171f14  {2.1302879E-19f * 5.4316195E-20f == 1.1570912E-38f}

} {PASS}
Test Case: 15.17.1-double-1
NaN * NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-1 { NaN * NaN is NaN } {
    
    constant_expression T15171d1  {Double.NaN * Double.NaN != Double.NaN * Double.NaN}

} {PASS}
Test Case: 15.17.1-double-2
NaN * anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-2 { NaN * anything is NaN } {
    
    constant_expression T15171d2 {Double.NaN * 1d != Double.NaN * 1d}

} {PASS}
Test Case: 15.17.1-double-3
the result is positive in floating-point multiplication if both operands have the same sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-3 { the result is positive in floating-point
        multiplication if both operands have the same sign } {
    
    constant_expression T15171d3 {-1d * -2d > 0d} {1d * 2d > 0d}

} {PASS}
Test Case: 15.17.1-double-4
the result is negative in floating-point multiplication if the operands have opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-4 { the result is negative in floating-point
        multiplication if the operands have opposite sign } {
    
    constant_expression T15171d4 {-1.0 * 2.0 < 0.0} {1.0 * -2.0 < 0.0}

} {PASS}
Test Case: 15.17.1-double-5
Infinity * 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-5 { Infinity * 0 is NaN } {
    
    constant_expression T15171d5  {Double.POSITIVE_INFINITY * 0d != Double.POSITIVE_INFINITY * 0d}

} {PASS}
Test Case: 15.17.1-double-6
Infinity * finite == Infinity of correct sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-6 { Infinity * finite == Infinity of correct sign } {
    
    constant_expression T15171d6  {Double.NEGATIVE_INFINITY * -1d == Double.POSITIVE_INFINITY}  {Double.POSITIVE_INFINITY * -1d == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-double-7
Infinity * Infinity == Infinity of correct sign (Specified in JVMS errata)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-7 { Infinity * Infinity == Infinity of correct sign
        (Specified in JVMS errata) } {
    
    constant_expression T15171d7  {Double.NEGATIVE_INFINITY * Double.NEGATIVE_INFINITY == Double.POSITIVE_INFINITY}  {Double.POSITIVE_INFINITY * Double.POSITIVE_INFINITY == Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-double-8
Infinity * Infinity == Infinity of correct sign (Specified in JVMS errata)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-8 { Infinity * Infinity == Infinity of correct sign
        (Specified in JVMS errata) } {
    
    constant_expression T15171d8  {Double.NEGATIVE_INFINITY * Double.POSITIVE_INFINITY == Double.NEGATIVE_INFINITY}  {Double.POSITIVE_INFINITY * Double.NEGATIVE_INFINITY == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-double-9
Floating-point * produces Infinity for overflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-9 { Floating-point * produces Infinity for overflow } {
    
    constant_expression T15171d9  {1.0e160 * 1.0e160 == Double.POSITIVE_INFINITY}  {1.0e160 * -1.0e160 == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-double-10
Floating-point * supports gradual underflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-10 { Floating-point * supports gradual underflow } {
    
    constant_expression T15171d10  {1e-160 * 1e-160 == 1e-320}  {1e-160 * -1e-160 == -1e-320}

} {PASS}
Test Case: 15.17.1-double-11
Floating-point * produces 0 for underflow (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-11 { Floating-point * produces 0 for underflow 
        (check 1/0 to determine sign) } {
    
    constant_expression T15171d11  {1e-170 * 1e-170 == 0}  {1/(1e-170 * 1e-170) == Double.POSITIVE_INFINITY}  {1e-170 * -1e-170 == 0}  {1/(1e-170 * -1e-170) == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.1-double-12
Floating-point * works even with denorms

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-12 { Floating-point * works even with denorms } {
    
    constant_expression T15171d12  {1e300 * 1e-320 == 9.99988867182683E-21}  {1e300 * -1e-320 == -9.99988867182683E-21}  {1e-320 * -1e300 == -9.99988867182683E-21}  {-1e-320 * -1e300 == 9.99988867182683E-21}

} {PASS}
Test Case: 15.17.1-double-13
Floating-point * follows round-to-nearest rules

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-13 { Floating-point * follows round-to-nearest rules } {
    
    constant_expression T15171d13  {0x10000000000001L * 3d == 0x30000000000004L}  {0x10000000000001L * 5d == 0x50000000000004L}  {0x10000000000003L * 5d == 0x50000000000010L}  {0x10000000000002L * 5d == 0x50000000000008L}

} {PASS}
Test Case: 15.17.1-double-14
Floating-point * follows round-to-nearest, even with denorms, known bug in Sun's javac

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-double-14 { Floating-point * follows round-to-nearest,
        even with denorms, known bug in Sun's javac } {
    
    constant_expression T15171d14  {8.578459548793971E-162 * 2.512418001798401E-147
            == 2.155267619808936E-308}  {6.946121092140867E-162 * 2.669444126910801E-147
            == 1.8542282154226677E-308}

} {PASS}
Test Case: 15.17.1-int-1
overflow in integer multiplication, simply selects low-order bits, possibly changing sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-int-1 { overflow in integer multiplication, simply 
        selects low-order bits, possibly changing sign } {
    
    constant_expression T15171i1 {1234567890 * 10 == -539222988}

} {PASS}
Test Case: 15.17.1-int-2
constant expression with int multiplication

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-int-2 { constant expression with int multiplication } {
    
    constant_expression T15171i2  {-12300000 == 100000 * -123}  {-50000000 == 500 * -100000}

} {PASS}
Test Case: 15.17.1-long-1
constant expression with long multiplication

Expected Result: PASS

Regression Test:

tcltest::test 15.17.1-long-1 { constant expression with long multiplication } {
    
    constant_expression T15171l1  {-12192592592745L == 987654321L * -12345}  {-12192592592745L == 12345 * -987654321L}  {12192592592745L == 987654321L * 12345}  {12192592592745L == -987654321L * -12345}

} {PASS}

15.17.2

Directory : tests/jls/expressions/multiplicative-operators/division-operator


Test Case: 15.17.2-assoc-1
division is left-associative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-assoc-1 { division is left-associative } {
    
    constant_expression T15172assoc1  {10 / 3 / 2 == 1} {10 / (3 / 2) == 10}

} {PASS}
Test Case: 15.17.2-assoc-2
division is left-associative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-assoc-2 { division is left-associative } {
    
    constant_expression T15172assoc2  {10.0 / 3.0 / 2.0 == 1.6666666666666667}  {10.0 / (3.0 / 2.0) == 6.666666666666667}

} {PASS}
Test Case: 15.17.2-float-1
NaN / NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-1 { NaN / NaN is NaN } {
    
    constant_expression T15172f1  {Float.NaN / Float.NaN != Float.NaN / Float.NaN}

} {PASS}
Test Case: 15.17.2-float-2
NaN / anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-2 { NaN / anything is NaN } {
    
    constant_expression T15172f2  {Float.NaN / 1f != Float.NaN / 1f}  {1f / Float.NaN != 1f / Float.NaN}

} {PASS}
Test Case: 15.17.2-float-3
the result is positive in floating-point division if both operands have the same sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-3 { the result is positive in floating-point
        division if both operands have the same sign } {
    
    constant_expression T15172f3 {-1f / -2f > 0f} {1f / 2f > 0f}

} {PASS}
Test Case: 15.17.2-float-4
the result is negative in floating-point division if the operands have opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-4 { the result is negative in floating-point
        division if the operands have opposite sign } {
    
    constant_expression T15172f4 {-1f / 2f < 0f} {1f / -2f < 0f}

} {PASS}
Test Case: 15.17.2-float-5
0 / 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-5 { 0 / 0 is NaN } {
    
    constant_expression T15172f5  {0f / 0f != 0f / 0f}  {-0f / 0f != -0f / 0f}

} {PASS}
Test Case: 15.17.2-float-6
Infinity / finite == Infinity of correct sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-6 { Infinity / finite == Infinity of correct sign } {
    
    constant_expression T15172f6  {Float.NEGATIVE_INFINITY / -1f == Float.POSITIVE_INFINITY}  {Float.POSITIVE_INFINITY / -1f == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-float-7
Infinity / Infinity is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-7 { Infinity / Infinity is NaN } {
    
    constant_expression T15172f7  {Float.NEGATIVE_INFINITY / Float.NEGATIVE_INFINITY !=
            Float.NEGATIVE_INFINITY / Float.NEGATIVE_INFINITY}  {Float.POSITIVE_INFINITY / Float.NEGATIVE_INFINITY !=
            Float.POSITIVE_INFINITY / Float.NEGATIVE_INFINITY}  {Float.NEGATIVE_INFINITY / Float.POSITIVE_INFINITY !=
            Float.NEGATIVE_INFINITY / Float.POSITIVE_INFINITY}  {Float.POSITIVE_INFINITY / Float.POSITIVE_INFINITY !=
            Float.POSITIVE_INFINITY / Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-float-8
Finite / Infinity == Signed zero (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-8 { Finite / Infinity == Signed zero
        (check 1/0 to determine sign) } {
    
    constant_expression T15172f8  {1f / Float.NEGATIVE_INFINITY == 0}  {1/(1f / Float.NEGATIVE_INFINITY) == Float.NEGATIVE_INFINITY}  {1f / Float.POSITIVE_INFINITY == 0}  {1/(1f / Float.POSITIVE_INFINITY) == Float.POSITIVE_INFINITY}  {-1f / Float.NEGATIVE_INFINITY == 0}  {1/(-1f / Float.NEGATIVE_INFINITY) == Float.POSITIVE_INFINITY}  {-1f / Float.POSITIVE_INFINITY == 0}  {1/(-1f / Float.POSITIVE_INFINITY) == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-float-9
Finite / 0 == Signed infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-9 { Finite / 0 == Signed infinity } {
    
    constant_expression T15172f9  {1f / 0f == Float.POSITIVE_INFINITY}  {-1f / 0f == Float.NEGATIVE_INFINITY}  {1f / -0f == Float.NEGATIVE_INFINITY}  {-1f / -0f == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-float-10
0 / non-zero Finite == Signed zero (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-10 { 0 / non-zero Finite == Signed zero
        (check 1/0 to determine sign) } {
    
    constant_expression T15172f10  {0f / 1f == 0} {1/(0f / 1f) == Float.POSITIVE_INFINITY}  {-0f / 1f == 0} {1/(-0f / 1f) == Float.NEGATIVE_INFINITY}  {0f / -1f == 0} {1/(0f / -1f) == Float.NEGATIVE_INFINITY}  {-0f / -1f == 0} {1/(-0f / -1f) == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-float-11
Floating-point / produces Infinity for overflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-11 { Floating-point / produces Infinity for overflow } {
    
    constant_expression T15172f11  {1.0e30f / 1.0e-30f == Float.POSITIVE_INFINITY}  {1.0e30f / -1.0e-30f == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-float-12
Floating-point / supports gradual underflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-12 { Floating-point / supports gradual underflow } {
    
    constant_expression T15172f12  {1e-22f / 1e22f == 1e-44f}  {1e-22f / -1e22f == -1e-44f}

} {PASS}
Test Case: 15.17.2-float-13
Floating-point / produces 0 for underflow (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-13 { Floating-point / produces 0 for underflow 
        (check 1/0 to determine sign) } {
    
    constant_expression T15172f13  {1e-30f / 1e30f == 0}  {1/(1e-30f / 1e30f) == Float.POSITIVE_INFINITY}  {1e-30f / -1e30f == 0}  {1/(1e-30f / -1e30f) == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-float-14
Floating-point / works even with denorms

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-14 { Floating-point / works even with denorms } {
    
    constant_expression T15172f14  {1e-10f / 1e-40f == 1.0000054E30f}  {1e-10f / -1e-40f == -1.0000054E30f}  {1e-40f / -1e-10f == -9.999946E-31f}  {-1e-40f / -1e-10f == 9.999946E-31f}

} {PASS}
Test Case: 15.17.2-float-15
Floating-point / follows round-to-nearest rules

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-float-15 { Floating-point / follows round-to-nearest rules } {
    
    constant_expression T15172f15  {0x1800004 / 3f == 0x800001}  {0x1800008 / 3f == 0x800003}  {7e-45f / 2f == 2.8e-45f}  {9.8e-45f / 2f == 5.6e-45f}

} {PASS}
Test Case: 15.17.2-double-1
NaN / NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-1 { NaN / NaN is NaN } {
    
    constant_expression T15172d1  {Double.NaN / Double.NaN != Double.NaN / Double.NaN}

} {PASS}
Test Case: 15.17.2-double-2
NaN / anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-2 { NaN / anything is NaN } {
    
    constant_expression T15172d2  {Double.NaN / 1d != Double.NaN / 1d}  {1d / Double.NaN != 1d / Double.NaN}

} {PASS}
Test Case: 15.17.2-double-3
the result is positive in floating-point division if both operands have the same sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-3 { the result is positive in floating-point
        division if both operands have the same sign } {
    
    constant_expression T15172d3 {-1d / -2d > 0d} {1d / 2d > 0d}

} {PASS}
Test Case: 15.17.2-double-4
the result is negative in floating-point division if the operands have opposite sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-4 { the result is negative in floating-point
        division if the operands have opposite sign } {
    
    constant_expression T15172d4 {-1.0 / 2.0 < 0.0} {1.0 / -2.0 < 0.0}

} {PASS}
Test Case: 15.17.2-double-5
0 / 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-5 { 0 / 0 is NaN } {
    
    constant_expression T15172d5  {0d / 0d != 0d / 0d}  {-0d / 0d != -0d / 0d}

} {PASS}
Test Case: 15.17.2-double-6
Infinity / finite == Infinity of correct sign

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-6 { Infinity / finite == Infinity of correct sign } {
    
    constant_expression T15172d6  {Double.NEGATIVE_INFINITY / -1d == Double.POSITIVE_INFINITY}  {Double.POSITIVE_INFINITY / -1d == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-double-7
Infinity / Infinity is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-7 { Infinity / Infinity is NaN } {
    
    constant_expression T15172d7  {Double.NEGATIVE_INFINITY / Double.NEGATIVE_INFINITY !=
            Double.NEGATIVE_INFINITY / Double.NEGATIVE_INFINITY}  {Double.POSITIVE_INFINITY / Double.NEGATIVE_INFINITY !=
            Double.POSITIVE_INFINITY / Double.NEGATIVE_INFINITY}  {Double.NEGATIVE_INFINITY / Double.POSITIVE_INFINITY !=
            Double.NEGATIVE_INFINITY / Double.POSITIVE_INFINITY}  {Double.POSITIVE_INFINITY / Double.POSITIVE_INFINITY !=
            Double.POSITIVE_INFINITY / Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-double-8
Finite / Infinity == Signed zero (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-8 { Finite / Infinity == Signed zero
        (check 1/0 to determine sign) } {
    
    constant_expression T15172d8  {1d / Double.NEGATIVE_INFINITY == 0}  {1/(1d / Double.NEGATIVE_INFINITY) == Double.NEGATIVE_INFINITY}  {1d / Double.POSITIVE_INFINITY == 0}  {1/(1d / Double.POSITIVE_INFINITY) == Double.POSITIVE_INFINITY}  {-1d / Double.NEGATIVE_INFINITY == 0}  {1/(-1d / Double.NEGATIVE_INFINITY) == Double.POSITIVE_INFINITY}  {-1d / Double.POSITIVE_INFINITY == 0}  {1/(-1d / Double.POSITIVE_INFINITY) == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-double-9
Finite / 0 == Signed infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-9 { Finite / 0 == Signed infinity } {
    
    constant_expression T15172d9  {1d / 0d == Double.POSITIVE_INFINITY}  {-1d / 0d == Double.NEGATIVE_INFINITY}  {1d / -0d == Double.NEGATIVE_INFINITY}  {-1d / -0d == Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-double-10
0 / non-zero Finite == Signed zero (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-10 { 0 / non-zero Finite == Signed zero
        (check 1/0 to determine sign) } {
    
    constant_expression T15172d10  {0d / 1d == 0} {1/(0d / 1d) == Double.POSITIVE_INFINITY}  {-0d / 1d == 0} {1/(-0d / 1d) == Double.NEGATIVE_INFINITY}  {0d / -1d == 0} {1/(0d / -1d) == Double.NEGATIVE_INFINITY}  {-0d / -1d == 0} {1/(-0d / -1d) == Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-double-11
Floating-point / produces Infinity for overflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-11 { Floating-point / produces Infinity for overflow } {
    
    constant_expression T15172d11  {1.0e160 / 1.0e-160 == Double.POSITIVE_INFINITY}  {1.0e160 / -1.0e-160 == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-double-12
Floating-point / supports gradual underflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-12 { Floating-point / supports gradual underflow } {
    
    constant_expression T15172d12  {1e-160 / 1e160 == 1e-320}  {1e-160 / -1e160 == -1e-320}

} {PASS}
Test Case: 15.17.2-double-13
Floating-point / produces 0 for underflow (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-13 { Floating-point / produces 0 for underflow 
        (check 1/0 to determine sign) } {
    
    constant_expression T15172d13  {1e-170 / 1e170 == 0}  {1/(1e-170 / 1e170) == Double.POSITIVE_INFINITY}  {1e-170 / -1e170 == 0}  {1/(1e-170 / -1e170) == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.2-double-14
Floating-point / works even with denorms

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-14 { Floating-point / works even with denorms } {
    
    constant_expression T15172d14  {1e-20 / 1e-320 == 1.0000111329412579e300}  {1e-20 / -1e-320 == -1.0000111329412579e300}  {1e-320 / -1e-20 == -9.999888671826831E-301}  {-1e-320 / -1e-20 == 9.999888671826831E-301}

} {PASS}
Test Case: 15.17.2-double-15
Floating-point / follows round-to-nearest rules

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-double-15 { Floating-point / follows round-to-nearest rules } {
    
    constant_expression T15172d15  {0x30000000000004L / 3d == 0x10000000000001L}  {0x30000000000008L / 3d == 0x10000000000003L}  {2.5e-323 / 2d == 1e-323}  {3.5e-323 / 2d == 2e-323}

} {PASS}
Test Case: 15.17.2-int-1
integer division rounds to 0

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-int-1 { integer division rounds to 0 } {
    
    constant_expression T15172i1  {5 / 3 == 1}  {5 / -3 == -1}  {-5 / 3 == -1}  {-5 / -3 == 1}

} {PASS}
Test Case: 15.17.2-int-2
MIN_INT / -1 overflows

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-int-2 { MIN_INT / -1 overflows } {
    
    constant_expression T15172i2 {0x80000000 / -1 == 0x80000000}

} {PASS}
Test Case: 15.17.2-int-3
Compile-time error to divide by constant 0

Expected Result: FAIL

Regression Test:

tcltest::test 15.17.2-int-3 { Compile-time error to divide by constant 0 } {
    
    empty_class T15172i3 {int i = 1 / 0;}

} {FAIL}
Test Case: 15.17.2-long-1
integer division rounds to 0

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-long-1 { integer division rounds to 0 } {
    
    constant_expression T15172l1  {5L / 3L == 1L}  {5L / -3L == -1L}  {-5L / 3L == -1L}  {-5L / -3L == 1L}

} {PASS}
Test Case: 15.17.2-long-2
MIN_LONG / -1 overflows

Expected Result: PASS

Regression Test:

tcltest::test 15.17.2-long-2 { MIN_LONG / -1 overflows } {
    
    constant_expression T15172l2 {0x8000000000000000L / -1L == 0x8000000000000000L}

} {PASS}
Test Case: 15.17.2-long-3
Compile-time error to divide by constant 0

Expected Result: FAIL

Regression Test:

tcltest::test 15.17.2-long-3 { Compile-time error to divide by constant 0 } {
    
    empty_class T15172l3 {long l = 1L / 0L;}

} {FAIL}

15.17.3

Directory : tests/jls/expressions/multiplicative-operators/remainder-operator


Test Case: 15.17.3-assoc-1
remainder is left-associative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-assoc-1 { remainder is left-associative } {
    
    constant_expression T15173assoc1  {10 % 4 % 3 == 2} {10 % (4 % 3) == 0}

} {PASS}
Test Case: 15.17.3-assoc-2
remainder is left-associative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-assoc-2 { remainder is left-associative } {
    
    constant_expression T15173assoc2  {10.0 % 4.0 % 3.0 == 2.0}  {10.0 % (4.0 % 3.0) == 0.0}

} {PASS}
Test Case: 15.17.3-float-1
NaN % NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-1 { NaN % NaN is NaN } {
    
    constant_expression T15173f1  {Float.NaN % Float.NaN != Float.NaN % Float.NaN}

} {PASS}
Test Case: 15.17.3-float-2
NaN % anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-2 { NaN % anything is NaN } {
    
    constant_expression T15173f2  {Float.NaN % 1f != Float.NaN % 1f}  {1f % Float.NaN != 1f % Float.NaN}

} {PASS}
Test Case: 15.17.3-float-3
the result is positive in floating-point remainder if the dividend is positive

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-3 { the result is positive in floating-point
        remainder if the dividend is positive } {
    
    constant_expression T15173f3 {3f % -2f > 0f} {3f % 2f > 0f}

} {PASS}
Test Case: 15.17.3-float-4
the result is negative in floating-point remainder if the dividend is negative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-4 { the result is negative in floating-point
        remainder if the dividend is negative } {
    
    constant_expression T15173f4 {-3f % 2f < 0f} {-3f % -2f < 0f}

} {PASS}
Test Case: 15.17.3-float-5
0 % 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-5 { 0 % 0 is NaN } {
    
    constant_expression T15173f5  {0f % 0f != 0f % 0f}  {-0f % 0f != -0f % 0f}

} {PASS}
Test Case: 15.17.3-float-6
Infinity % finite is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-6 { Infinity % finite is NaN } {
    
    constant_expression T15173f6  {Float.NEGATIVE_INFINITY % -1f != Float.NEGATIVE_INFINITY % -1f}  {Float.POSITIVE_INFINITY % -1f != Float.POSITIVE_INFINITY % -1f}

} {PASS}
Test Case: 15.17.3-float-7
Infinity % Infinity is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-7 { Infinity % Infinity is NaN } {
    
    constant_expression T15173f7  {Float.NEGATIVE_INFINITY % Float.NEGATIVE_INFINITY !=
            Float.NEGATIVE_INFINITY % Float.NEGATIVE_INFINITY}  {Float.POSITIVE_INFINITY % Float.NEGATIVE_INFINITY !=
            Float.POSITIVE_INFINITY % Float.NEGATIVE_INFINITY}  {Float.NEGATIVE_INFINITY % Float.POSITIVE_INFINITY !=
            Float.NEGATIVE_INFINITY % Float.POSITIVE_INFINITY}  {Float.POSITIVE_INFINITY % Float.POSITIVE_INFINITY !=
            Float.POSITIVE_INFINITY % Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.3-float-8
Finite % Infinity == dividend

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-8 { Finite % Infinity == dividend } {
    
    constant_expression T15173f8  {1f % Float.NEGATIVE_INFINITY == 1f}  {1f % Float.POSITIVE_INFINITY == 1f}  {-1f % Float.NEGATIVE_INFINITY == -1f}  {-1f % Float.POSITIVE_INFINITY == -1f}

} {PASS}
Test Case: 15.17.3-float-9
Finite % 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-9 { Finite % 0 is NaN } {
    
    constant_expression T15173f9  {1f % 0f != 1f % 0f}  {-1f % 0f != -1f % 0f}  {1f % -0f != 1f % -0f}  {-1f % -0f != -1f % -0f}

} {PASS}
Test Case: 15.17.3-float-10
0 % non-zero Finite == Dividend (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-10 { 0 % non-zero Finite == Dividend
        (check 1/0 to determine sign) } {
    
    constant_expression T15173f10  {0f % 1f == 0} {1/(0f % 1f) == Float.POSITIVE_INFINITY}  {-0f % 1f == 0} {1/(-0f % 1f) == Float.NEGATIVE_INFINITY}  {0f % -1f == 0} {1/(0f % -1f) == Float.POSITIVE_INFINITY}  {-0f % -1f == 0} {1/(-0f % -1f) == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.3-float-11
0 % Infinity == Dividend (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-11 { 0 % Infinity == Dividend
        (check 1/0 to determine sign) } {
    
    constant_expression T15173f11  {0f % Float.POSITIVE_INFINITY == 0}  {1/(0f % Float.POSITIVE_INFINITY) == Float.POSITIVE_INFINITY}  {-0f % Float.POSITIVE_INFINITY == 0}  {1/(-0f % Float.POSITIVE_INFINITY) == Float.NEGATIVE_INFINITY}  {0f % Float.NEGATIVE_INFINITY == 0}  {1/(0f % Float.NEGATIVE_INFINITY) == Float.POSITIVE_INFINITY}  {-0f % Float.NEGATIVE_INFINITY == 0}  {1/(-0f % Float.NEGATIVE_INFINITY) == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.3-float-12
Floating-point % cannot overflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-12 { Floating-point % cannot overflow } {
    
    constant_expression T15173f12  {1e30f % 1e-30f == 8.166816e-31f}  {-1e30f % -1e-30f == -8.166816e-31f}

} {PASS}
Test Case: 15.17.3-float-13
Floating-point % works even with denorms

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-13 { Floating-point % works even with denorms } {
    
    constant_expression T15173f13  {1e30f % 1e-40f == 7.121e-42f}  {1e30f % -1e-40f == 7.121e-42f}  {-1e-40f % 1e30f == -1e-40f}  {-1e-40f % -1e30f == -1e-40f}

} {PASS}
Test Case: 15.17.3-float-14
Example cases

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-float-14 { Example cases } {
    
    constant_expression T15173f14  {5.0f % 3.0f == 2.0f}  {5.0f % -3.0f == 2.0f}  {-5.0f % 3.0f == -2.0f}  {-5.0f % -3.0f == -2.0f}

} {PASS}
Test Case: 15.17.3-double-1
NaN % NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-1 { NaN % NaN is NaN } {
    
    constant_expression T15173d1  {Double.NaN % Double.NaN != Double.NaN % Double.NaN}

} {PASS}
Test Case: 15.17.3-double-2
NaN % anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-2 { NaN % anything is NaN } {
    
    constant_expression T15173d2  {Double.NaN % 1d != Double.NaN % 1d}  {1d % Double.NaN != 1d % Double.NaN}

} {PASS}
Test Case: 15.17.3-double-3
the result is positive in floating-point remainder if the dividend is positive

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-3 { the result is positive in floating-point
        remainder if the dividend is positive } {
    
    constant_expression T15173d3 {3d % -2d > 0d} {3d % 2d > 0d}

} {PASS}
Test Case: 15.17.3-double-4
the result is negative in floating-point remainder if the dividend is negative

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-4 { the result is negative in floating-point
        remainder if the dividend is negative } {
    
    constant_expression T15173d4 {-3d % 2d < 0d} {-3d % -2d < 0d}

} {PASS}
Test Case: 15.17.3-double-5
0 % 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-5 { 0 % 0 is NaN } {
    
    constant_expression T15173d5  {0d % 0d != 0d % 0d}  {-0d % 0d != -0d % 0d}

} {PASS}
Test Case: 15.17.3-double-6
Infinity % finite is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-6 { Infinity % finite is NaN } {
    
    constant_expression T15173d6  {Double.NEGATIVE_INFINITY % -1d != Double.NEGATIVE_INFINITY % -1d}  {Double.POSITIVE_INFINITY % -1d != Double.POSITIVE_INFINITY % -1d}

} {PASS}
Test Case: 15.17.3-double-7
Infinity % Infinity is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-7 { Infinity % Infinity is NaN } {
    
    constant_expression T15173d7  {Double.NEGATIVE_INFINITY % Double.NEGATIVE_INFINITY !=
            Double.NEGATIVE_INFINITY % Double.NEGATIVE_INFINITY}  {Double.POSITIVE_INFINITY % Double.NEGATIVE_INFINITY !=
            Double.POSITIVE_INFINITY % Double.NEGATIVE_INFINITY}  {Double.NEGATIVE_INFINITY % Double.POSITIVE_INFINITY !=
            Double.NEGATIVE_INFINITY % Double.POSITIVE_INFINITY}  {Double.POSITIVE_INFINITY % Double.POSITIVE_INFINITY !=
            Double.POSITIVE_INFINITY % Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.17.3-double-8
Finite % Infinity == dividend

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-8 { Finite % Infinity == dividend } {
    
    constant_expression T15173d8  {1d % Double.NEGATIVE_INFINITY == 1d}  {1d % Double.POSITIVE_INFINITY == 1d}  {-1d % Double.NEGATIVE_INFINITY == -1d}  {-1d % Double.POSITIVE_INFINITY == -1d}

} {PASS}
Test Case: 15.17.3-double-9
Finite % 0 is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-9 { Finite % 0 is NaN } {
    
    constant_expression T15173d9  {1d % 0d != 1d % 0d}  {-1d % 0d != -1d % 0d}  {1d % -0d != 1d % -0d}  {-1d % -0d != -1d % -0d}

} {PASS}
Test Case: 15.17.3-double-10
0 % non-zero Finite == Dividend (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-10 { 0 % non-zero Finite == Dividend
        (check 1/0 to determine sign) } {
    
    constant_expression T15173d10  {0d % 1d == 0} {1/(0d % 1d) == Double.POSITIVE_INFINITY}  {-0d % 1d == 0} {1/(-0d % 1d) == Double.NEGATIVE_INFINITY}  {0d % -1d == 0} {1/(0d % -1d) == Double.POSITIVE_INFINITY}  {-0d % -1d == 0} {1/(-0d % -1d) == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.3-double-11
0 % Infinity == Dividend (check 1/0 to determine sign)

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-11 { 0 % Infinity == Dividend
        (check 1/0 to determine sign) } {
    
    constant_expression T15173d11  {0d % Double.POSITIVE_INFINITY == 0}  {1/(0d % Double.POSITIVE_INFINITY) == Double.POSITIVE_INFINITY}  {-0d % Double.POSITIVE_INFINITY == 0}  {1/(-0d % Double.POSITIVE_INFINITY) == Double.NEGATIVE_INFINITY}  {0d % Double.NEGATIVE_INFINITY == 0}  {1/(0d % Double.NEGATIVE_INFINITY) == Double.POSITIVE_INFINITY}  {-0d % Double.NEGATIVE_INFINITY == 0}  {1/(-0d % Double.NEGATIVE_INFINITY) == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.17.3-double-12
Floating-point % cannot overflow

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-12 { Floating-point % cannot overflow } {
    
    constant_expression T15173d12  {1e300 % 1e-300 == 4.891554850853602e-301}  {-1e300 % -1e-300 == -4.891554850853602e-301}

} {PASS}
Test Case: 15.17.3-double-13
Floating-point % works even with denorms

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-13 { Floating-point % works even with denorms } {
    
    constant_expression T15173d13  {1e300 % 1e-320 == 3.16e-321}  {1e300 % -1e-320 == 3.16e-321}  {-1e-320 % 1e300 == -1e-320}  {-1e-320 % -1e300 == -1e-320}

} {PASS}
Test Case: 15.17.3-double-14
Example cases

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-double-14 { Example cases } {
    
    constant_expression T15173d14  {5.0 % 3.0 == 2.0}  {5.0 % -3.0 == 2.0}  {-5.0 % 3.0 == -2.0}  {-5.0 % -3.0 == -2.0}

} {PASS}
Test Case: 15.17.3-int-1
Example cases

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-int-1 { Example cases } {
    
    constant_expression T15173i1  {5 % 3 == 2}  {5 % -3 == 2}  {-5 % 3 == -2}  {-5 % -3 == -2}

} {PASS}
Test Case: 15.17.3-int-2
(a/b)*b+(a%b) == a

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-int-2 { (a/b)*b+(a%b) == a } {
    
    constant_expression T15173i2  {(0x80000000 / -1) * -1 + (0x80000000 % -1) == 0x80000000}  {(5 / 3) * 3 + (5 % 3) == 5}  {(5 / -3) * -3 + (5 % -3) == 5}  {(-5 / 3) * 3 + (-5 % 3) == -5}  {(-5 / -3) * -3 + (-5 % -3) == -5}

} {PASS}
Test Case: 15.17.3-int-3
Compile-time error to divide by constant 0

Expected Result: FAIL

Regression Test:

tcltest::test 15.17.3-int-3 { Compile-time error to divide by constant 0 } {
    
    empty_class T15173i3 {int i = 1 / 0;}

} {FAIL}
Test Case: 15.17.3-int-4
MIN_INT % -1 == 0

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-int-4 { MIN_INT % -1 == 0 } {
    
    constant_expression T15173i4 {0x80000000 % -1 == 0}

} {PASS}
Test Case: 15.17.3-long-1
Example cases

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-long-1 { Example cases } {
    
    constant_expression T15173l1  {5L % 3L == 2L}  {5L % -3L == 2L}  {-5L % 3L == -2L}  {-5L % -3L == -2L}

} {PASS}
Test Case: 15.17.3-long-2
(a/b)*b+(a%b) == a

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-long-2 { (a/b)*b+(a%b) == a } {
    
    constant_expression T15173l2  {(0x8000000000000000L / -1L) * -1L + (0x8000000000000000L % -1L)
            == 0x8000000000000000L}  {(5L / 3L) * 3L + (5L % 3L) == 5L}  {(5L / -3L) * -3L + (5L % -3L) == 5L}  {(-5L / 3L) * 3L + (-5L % 3L) == -5L}  {(-5L / -3L) * -3L + (-5L % -3L) == -5L}

} {PASS}
Test Case: 15.17.3-long-3
Compile-time error to divide by constant 0

Expected Result: FAIL

Regression Test:

tcltest::test 15.17.3-long-3 { Compile-time error to divide by constant 0 } {
    
    empty_class T15173l3 {long l = 1L % 0L;}

} {FAIL}
Test Case: 15.17.3-long-4
MIN_LONG % -1 == 0

Expected Result: PASS

Regression Test:

tcltest::test 15.17.3-long-4 { MIN_LONG % -1 == 0 } {
    
    constant_expression T15173l4 {0x8000000000000000L % -1L == 0L}

} {PASS}

15.18

Directory : tests/jls/expressions/additive-operators


Test Case: 15.18-null-1
at least one argument of + should be String, or else both must be primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.18-null-1 { at least one argument of + should be String,
        or else both must be primitive numeric type } {
    
    # Sun seems to have relaxed this so that null is used as type String
    is_assignable_to T1518n1 String {null + null}

} {FAIL}
Test Case: 15.18-null-2
both arguments to - must be of a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.18-null-2 { both arguments to - must be of a
        primitive numeric type } {
    
    is_assignable_to T1518n2 String {null - null}

} {FAIL}
Test Case: 15.18-boolean-1
at least one argument of + should be String, or else both must be primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.18-boolean-1 { at least one argument of + should be String,
        or else both must be primitive numeric type } {
    
    is_assignable_to T1518b1 boolean {true + false}

} {FAIL}
Test Case: 15.18-boolean-2
both arguments to - must be of a primitive numeric type

Expected Result: FAIL

Regression Test:

tcltest::test 15.18-boolean-2 { both arguments to - must be of a
        primitive numeric type } {
    
    is_assignable_to T1518b2 boolean {5 - false}

} {FAIL}

15.18.1

Directory : tests/jls/expressions/additive-operators/string-concatenation-operator


Test Case: 15.18.1-1
String + requires a String argument

Expected Result: FAIL

Regression Test:

tcltest::test 15.18.1-1 { String + requires a String argument } {
    
    # Sun seems to have relaxed this so that null is used as type String implicitly
    is_assignable_to T151811 String {null + 1} String {1 + null}

} {FAIL}
Test Case: 15.18.1-2
(String)null denotes String concatenation

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-2 { (String)null denotes String concatenation } {
    
    is_assignable_to T151812 String {(String)null + 1} String {1 + (String)null}

} {PASS}
Test Case: 15.18.1-3
(String)null + null denotes String concatenation

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-3 { (String)null + null denotes String concatenation } {
    
    is_assignable_to T151813  String {null + (String)null}  String {(String)null + null}  String {(String)null + (String)null}

} {PASS}
Test Case: 15.18.1-4
void + String is invalid

Expected Result: FAIL

Regression Test:

tcltest::test 15.18.1-4 { void + String is invalid } {
    
    is_assignable_to T151814  String {System.out.println() + ""}  String {"" + System.out.println()}

} {FAIL}
Test Case: 15.18.1-5
+ operator should be left-associative

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-5 { + operator should be left-associative } {
    
    constant_expression T151815  {1 + 2 + " fiddlers" == "3 fiddlers"}  {"fiddlers " + 1 + 2 == "fiddlers 12"}

} {PASS}
Test Case: 15.18.1-6
+ operator and integer constants

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-6 { + operator and integer constants } {
    
    constant_expression T151816  {"-12300000" == "" + -12300000}  {"-12300000,-50000000" ==
            -12300000 + "," + -50000000}

} {PASS}
Test Case: 15.18.1-7
+ operator and long constants

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-7 { + operator and long constants } {
    
    constant_expression T151817  {"-12192592592745" == "" + -12192592592745L}  {"-12192592592745,-12192592592745" ==
            -12192592592745L + "," + -12192592592745L}

} {PASS}
Test Case: 15.18.1-float-1
convert denormalized float to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-float-1 { convert denormalized float to String } {
    
    constant_expression T15181f1 {"" + 1e-44f == "9.8E-45"}

} {PASS}
Test Case: 15.18.1-float-2
convert NaN float to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-float-2 { convert NaN float to String } {
    
    constant_expression T15181f2 {"" + Float.NaN == "NaN"} {"" + (-Float.NaN) == "NaN"}

} {PASS}
Test Case: 15.18.1-float-3
convert Infinity float to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-float-3 { convert Infinity float to String } {
    
    constant_expression T15181f3 {"" + Float.NEGATIVE_INFINITY == "-Infinity"}  {"" + Float.POSITIVE_INFINITY == "Infinity"}

} {PASS}
Test Case: 15.18.1-float-4
convert min float to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-float-4 { convert min float to String } {
    
    constant_expression T15181f4 {"" +  Float.MIN_VALUE == "1.4E-45"}

} {PASS}
Test Case: 15.18.1-float-5
convert max float to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-float-5 { convert max float to String } {
    
    constant_expression T15181f5 {"" +  Float.MAX_VALUE == "3.4028235E38"}

} {PASS}
Test Case: 15.18.1-float-6
conversion of float to String must use as few digits after decimal as produce the same float again by rounding

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-float-6 { conversion of float to String must use as few
        digits after decimal as produce the same float again by rounding } {
    
    constant_expression T15181f6  {"" + 123456768f == "1.2345677E8"}  {"" + 123456776f == "1.23456776E8"}  {"" + 123456784f == "1.2345678E8"}  {"" + 123456792f == "1.2345679E8"}  {"" + 123456800f == "1.234568E8"}

} {PASS}
Test Case: 15.18.1-double-1
convert denormalized double to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-double-1 { convert denormalized double to String } {
    
    constant_expression T15181d1 {"" + 1e-315 == "1.0E-315"}

} {PASS}
Test Case: 15.18.1-double-2
convert Nan double to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-double-2 { convert Nan double to String } {
    
    constant_expression T15181d2 {"" + Double.NaN == "NaN"} {"" + (-Double.NaN) == "NaN"}

} {PASS}
Test Case: 15.18.1-double-3
convert Infinity double to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-double-3 { convert Infinity double to String } {
    
    constant_expression T15181d3 {"" + Double.NEGATIVE_INFINITY == "-Infinity"}  {"" + Double.POSITIVE_INFINITY == "Infinity"}

} {PASS}
Test Case: 15.18.1-double-4
convert min double to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-double-4 { convert min double to String } {
    
    constant_expression T15181d4 {"" + Double.MIN_VALUE == "4.9E-324"}

} {PASS}
Test Case: 15.18.1-double-5
convert max double to String

Expected Result: PASS

Regression Test:

tcltest::test 15.18.1-double-5 { convert max double to String } {
    
    constant_expression T15181d5 {"" + Double.MAX_VALUE == "1.7976931348623157E308"}

} {PASS}

15.18.2

Directory : tests/jls/expressions/additive-operators/numeric-types


Test Case: 15.18.2-commute-1
side-effect-free addition is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-commute-1 { side-effect-free addition is commutative } {
    
    constant_expression T15182commute1 {1 + 2 == 2 + 1}

} {PASS}
Test Case: 15.18.2-commute-2
side-effect-free addition is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-commute-2 { side-effect-free addition is commutative } {
    
    constant_expression T15182commute2 {1L + 2L == 2L + 1L}

} {PASS}
Test Case: 15.18.2-commute-3
side-effect-free addition is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-commute-3 { side-effect-free addition is commutative } {
    
    constant_expression T15182commute3 {1f + 2f == 2f + 1f}

} {PASS}
Test Case: 15.18.2-commute-4
side-effect-free addition is commutative

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-commute-4 { side-effect-free addition is commutative } {
    
    constant_expression T15182commute4 {1d + 2d == 2d + 1d}

} {PASS}
Test Case: 15.18.2-assoc-1
integer addition is associative when all arguments are of the same type

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-assoc-1 { integer addition is associative when
        all arguments are of the same type } {
    
    constant_expression T15182assoc1 {(1 + 2) + 3 == 1 + (2 + 3)}

} {PASS}
Test Case: 15.18.2-assoc-2
integer addition is not associative when arguments are of different types

Expected Result: FAIL

Regression Test:

tcltest::test 15.18.2-assoc-2 { integer addition is not associative
        when arguments are of different types } {
    
    constant_expression T15182assoc2  {(1L + 0x70000000) + 0x70000000 == 1L + (0x70000000 + 0x70000000)}

} {FAIL}
Test Case: 15.18.2-assoc-3
floating-point addition is not associative

Expected Result: FAIL

Regression Test:

tcltest::test 15.18.2-assoc-3 { floating-point addition is not associative } {
    
    constant_expression T15182assoc3  {(1e10f + 256f) + 256f == 1e10f + (256f + 256f)}

} {FAIL}
Test Case: 15.18.2-assoc-4
addition is left-associative

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-assoc-4 { addition is left-associative } {
    
    constant_expression T15182assoc3  {1e10f + 256f + 256f == (1e10f + 256f) + 256f}

} {PASS}
Test Case: 15.18.2-int-1
overflow in integer addition simply selects low-order bits, changing sign

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-int-1 { overflow in integer addition simply 
        selects low-order bits, changing sign } {
    
    constant_expression T15182i1 {1073741824 + 1073741824 == -2147483648}

} {PASS}
Test Case: 15.18.2-float-1
NaN + NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-1 { NaN + NaN is NaN } {
    
    constant_expression T15182f1  {Float.NaN + Float.NaN != Float.NaN + Float.NaN}

} {PASS}
Test Case: 15.18.2-float-2
NaN + anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-2 { NaN + anything is NaN } {
    
    constant_expression T15182f2 {Float.NaN + 1f != Float.NaN + 1f}

} {PASS}
Test Case: 15.18.2-float-3
the result of floating-point addition follows arithmetic sign rules

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-3 { the result of floating-point addition follows
        arithmetic sign rules } {
    
    constant_expression T15182f3 {-1f + -2f < 0f}

} {PASS}
Test Case: 15.18.2-float-4
the result of floating-point addition follows arithmetic sign rules

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-4 { the result of floating-point addition follows
        arithmetic sign rules } {
    
    constant_expression T15182f4 {-1.0f + 2.0f > 0f}

} {PASS}
Test Case: 15.18.2-float-5
Infinity + 0 = Infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-5 { Infinity + 0 = Infinity } {
    
    constant_expression T15182f5  {Float.POSITIVE_INFINITY + -0.0 == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-6
Infinity + finite = Same sign Infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-6 { Infinity + finite = Same sign Infinity } {
    
    constant_expression T15182f6  {Float.NEGATIVE_INFINITY + -1f == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-7
Sum of Infinities of same sign is Infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-7 { Sum of Infinities of same sign is Infinity } {
    
    constant_expression T15182f7  {Float.NEGATIVE_INFINITY + Float.NEGATIVE_INFINITY ==
	    Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-8
Sum of Infinities of opposite sign is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-8 { Sum of Infinities of opposite sign is NaN } {
    
    constant_expression T15182f8  {Float.NEGATIVE_INFINITY + Float.POSITIVE_INFINITY !=
	    Float.NEGATIVE_INFINITY + Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-9
Sum of zeroes of same sign is same zero

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-9 { Sum of zeroes of same sign is same zero } {
    
    constant_expression T15182f9 {1.0f / (-0.0f + -0.0f) == Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-10
Sum of zeroes of opposite sign is +0

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-10 { Sum of zeroes of opposite sign is +0 } {
    
    constant_expression T15182f10 {1.0f / (-0.0f + 0.0f) == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-11
Sum of oppositely signed floating-point is +0

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-11 { Sum of oppositely signed floating-point is +0 } {
    
    constant_expression T15182f11 {1.0f / (1.0f + -1.0f) == Float.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-12
0.0 - x is not negation, for x = 0.0

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-12 { 0.0 - x is not negation, for x = 0.0 } {
    
    constant_expression T15182f12 {1.0f / (0.0f - 0.0f) != Float.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-float-13
a - b == a + (-b)

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-13 { a - b == a + (-b) } {
    
    constant_expression T15182f13 {1.0f - 2.0f == 1.0f + -2.0f}

} {PASS}
Test Case: 15.18.2-float-14
Floating-point addition takes place with infinite accuracy, then rounds to nearest

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-14 { Floating-point addition takes place with
        infinite accuracy, then rounds to nearest } {
    
    constant_expression T15182f14 {0xfffff00 + 8.03125f == 0xfffff10}

} {PASS}
Test Case: 15.18.2-float-15
Floating-point addition takes place with infinite accuracy, then rounds to nearest

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-15 { Floating-point addition takes place with
        infinite accuracy, then rounds to nearest } {
    
    constant_expression T15182f15 {-0xfffff00 - -8.03125f == -0xffffef0}

} {PASS}
Test Case: 15.18.2-float-16
Floating-point addition takes place with infinite accuracy, then rounds to nearest

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-float-16 { Floating-point addition takes place with
        infinite accuracy, then rounds to nearest } {
    
    constant_expression T15182f16 {5.960465e-8f + 1 == 1.0000001f}

} {PASS}
Test Case: 15.18.2-double-1
NaN + NaN is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-1 { NaN + NaN is NaN } {
    
    constant_expression T15182d1  {Double.NaN + Double.NaN != Double.NaN + Double.NaN}

} {PASS}
Test Case: 15.18.2-double-2
NaN + anything is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-2 { NaN + anything is NaN } {
    
    constant_expression T15182d2 {Double.NaN + 1d != Double.NaN + 1d}

} {PASS}
Test Case: 15.18.2-double-3
the result of floating-point addition follows arithmetic sign rules

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-3 { the result of floating-point addition follows
        arithmetic sign rules } {
    
    constant_expression T15182d3 {-1d + -2d < 0d}

} {PASS}
Test Case: 15.18.2-double-4
the result of floating-point addition follows arithmetic sign rules

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-4 { the result of floating-point addition follows
        arithmetic sign rules } {
    
    constant_expression T15182d4 {-1.0 + 2.0 > 0.0}

} {PASS}
Test Case: 15.18.2-double-5
Infinity + 0 = Infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-5 { Infinity + 0 = Infinity } {
    
    constant_expression T15182d5  {Double.POSITIVE_INFINITY + 0d == Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-6
Infinity + finite = Same sign Infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-6 { Infinity + finite = Same sign Infinity } {
    
    constant_expression T15182d6  {Double.NEGATIVE_INFINITY + -1d == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-7
Sum of Infinities of same sign is Infinity

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-7 { Sum of Infinities of same sign is Infinity } {
    
    constant_expression T15182d7  {Double.NEGATIVE_INFINITY + Double.NEGATIVE_INFINITY ==
	    Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-8
Sum of Infinities of opposite sign is NaN

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-8 { Sum of Infinities of opposite sign is NaN } {
    
    constant_expression T15182d8  {Double.NEGATIVE_INFINITY + Double.POSITIVE_INFINITY !=
	    Double.NEGATIVE_INFINITY + Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-9
Sum of zeroes of same sign is same zero

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-9 { Sum of zeroes of same sign is same zero } {
    
    constant_expression T15182d9 {1.0 / (-0.0 + -0.0) == Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-10
Sum of zeroes of opposite sign is +0

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-10 { Sum of zeroes of opposite sign is +0 } {
    
    constant_expression T15182d10 {1.0 / (-0.0 + 0.0) == Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-11
Sum of oppositely signed floating-point is +0

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-11 { Sum of oppositely signed floating-point is +0 } {
    
    constant_expression T15182d11 {1.0 / (1.0 + -1.0) == Double.POSITIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-12
0.0 - x is not negation, for x = 0.0

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-12 { 0.0 - x is not negation, for x = 0.0 } {
    
    constant_expression T15182d12 {1.0 / (0.0 - 0.0) != Double.NEGATIVE_INFINITY}

} {PASS}
Test Case: 15.18.2-double-13
a - b == a + (-b)

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-13 { a - b == a + (-b) } {
    
    constant_expression T15182d13 {1.0 - 2.0 == 1.0 + -2.0}

} {PASS}
Test Case: 15.18.2-double-14
Floating-point addition takes place with infinite accuracy, then rounds to nearest

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-14 { Floating-point addition takes place with
        infinite accuracy, then rounds to nearest } {
    
    constant_expression T15182d14 {0x1ffffffffffff00L + 8.03125 == 0x1ffffffffffff10L }

} {PASS}
Test Case: 15.18.2-double-15
Floating-point addition takes place with infinite accuracy, then rounds to nearest

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-15 { Floating-point addition takes place with
        infinite accuracy, then rounds to nearest } {
    
    constant_expression T15182d15 {-0x1ffffffffffff00L - -8.03125 == -0x1fffffffffffef0L }

} {PASS}
Test Case: 15.18.2-double-16
Floating-point addition takes place with infinite accuracy, then rounds to nearest

Expected Result: PASS

Regression Test:

tcltest::test 15.18.2-double-16 { Floating-point addition takes place with
        infinite accuracy, then rounds to nearest } {
    
    constant_expression T15182d16 {1.1107651257113993e-16 + 1 == 1.0000000000000002}

} {PASS}

15.26.2

Directory : tests/jls/expressions/assignment-operators/compound-assignment-operators


Test Case: 15.26.2-string-1
String += null is valid

Expected Result: PASS

Regression Test:

tcltest::test 15.26.2-string-1 { String += null is valid } {
    
    compile [saveas T15262s1.java {
class T15262s1 {
    void foo() {
	String s = "";
	s += null;
    }
}
    }]

} {PASS}
Test Case: 15.26.2-string-2
String += void method is invalid

Expected Result: FAIL

Regression Test:

tcltest::test 15.26.2-string-2 { String += void method is invalid } {
    
  compile [saveas T15262s2.java {
class T15262s2 {
    void foo() {
	String s = "";
	s += System.out.println();
    }
}
    }]

} {FAIL}
Test Case: 15.26.2-string-3
left-hand side of += should be String

Expected Result: FAIL

Regression Test:

tcltest::test 15.26.2-string-3 { left-hand side of += should be String } {
    
    # Sun seems to have relaxed this to left-hand side of += should be
    # assignment compatible if right-hand side is type String (or null)
    compile [saveas T15262s3.java {
class T15262s3 {
    void foo() {
	Object o = null;
	o += "";
    }
}
    }]

} {FAIL}
Test Case: 15.26.2-string-4
left-hand side of += should be String

Expected Result: FAIL

Regression Test:

tcltest::test 15.26.2-string-4 { left-hand side of += should be String } {
    
    # Sun seems to have relaxed this to left-hand side of += should be
    # assignment compatible if right-hand side is type String (or null)
    compile [saveas T15262s4.java {
class T15262s4 {
    void foo() {
	Comparable[] c = new Integer[1];
	c[0] += "";
    }
}
    }]

} {FAIL}

15.28

Directory : tests/jls/expressions/constant-expression


Test Case: 15.28-primitive-1
literals are constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-1 { literals are constant expressions } {
    
    switch_labels T1528p1 int {case 1: case '1':}

} {PASS}
Test Case: 15.28-primitive-2
literals are constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-2 { literals are constant expressions } {
    
    constant_expression T1528p2 {1L == 1L} {1f == 1f} {1.0 == 1.0} {true}

} {PASS}
Test Case: 15.28-primitive-3
casts can form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-3 { casts can form constant expressions } {
    
    constant_expression T1528p3 {(boolean) true}  {(int) 1L == (float) 1.0}  {(char) 0x61 == 'a'}  {(char) 97.0D == 'a'}  {(double) 'a' == 97.0D}  {(int) 97L == (int) 'a'}

} {PASS}
Test Case: 15.28-primitive-4
Unary +, -, ~, ! form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-4 { Unary +, -, ~, ! form constant expressions } {
    
    constant_expression T1528p4 {+2 == 2} {-0x80000000 == 0x80000000}  {~0 == 0xffffffff} {!false}

} {PASS}
Test Case: 15.28-primitive-5
++ and -- are not constant expressions

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-primitive-5 { ++ and -- are not constant expressions } {
    
    empty_class T1528p5 {
        void foo(int i) {
            switch (i) {
                case i++:
            }
        }
    }

} {FAIL}
Test Case: 15.28-primitive-6
++ and -- are not constant expressions

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-primitive-6 { ++ and -- are not constant expressions } {
    
    empty_class T1528p6 {
        void foo(int i) {
            switch (i) {
                case i--:
            }
        }
    }

} {FAIL}
Test Case: 15.28-primitive-7
*, /, and % form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-7 { *, /, and % form constant expressions } {
    
    constant_expression T1528p7 {5 * 3 == 15} {5 / 3 == 1} {5 % 3 == 2}

} {PASS}
Test Case: 15.28-primitive-8
+ and - form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-8 { + and - form constant expressions } {
    
    constant_expression T1528p8 {1 + 2 == 3} {1 - 2 == -1}

} {PASS}
Test Case: 15.28-primitive-9
<<, >>, and >>> form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-9 { <<, >>, and >>> form constant expressions } {
    
    constant_expression T1528p9 {2 << 1 == 4} {2 >> 1 == 1} {-2 >>> 1 == 0x7fffffff}

} {PASS}
Test Case: 15.28-primitive-10
<, <=, >, and >= form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-10 { <, <=, >, and >= form constant expressions } {
    
    constant_expression T1528p10 {1 < 2} {2 <= 2} {2 > 1} {1 >= 1}

} {PASS}
Test Case: 15.28-primitive-11
== and != form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-11 { == and != form constant expressions } {
    
    constant_expression T1528p11 {1 == 1} {1 != 2}  {true == true} {true != false}  {'a' == 'a'} {'a' != 'b'}

} {PASS}
Test Case: 15.28-primitive-12
bitwise &, ^, and | form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-12 { bitwise &, ^, and | form constant expressions } {
    
    constant_expression T1528p12 {(0xaa & 0xa5) == 0xa0}  {(0xaa ^ 0xa5) == 0x0f}  {(0xaa | 0xa5) == 0xaf}

} {PASS}
Test Case: 15.28-primitive-13
logical &, ^, and | form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-13 { logical &, ^, and | form constant expressions } {
    
    constant_expression T1528p13 {true & true} {true ^ false} {false | true}

} {PASS}
Test Case: 15.28-primitive-14
&& and || form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-14 { && and || form constant expressions } {
    
    constant_expression T1528p14 {true && true} {true || false}

} {PASS}
Test Case: 15.28-primitive-15
short-circuited portion of && or || must still be constant expressions

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-primitive-15 { short-circuited portion of && or || must
        still be constant expressions } {
    
    empty_main T1528p15 {
        boolean t = true, f = false;
        switch (args.length) {
            case 0:
            case ((false && t) ? 0 : 1):
            case ((true || f) ? 2 : 0):
        }
    }

} {FAIL}
Test Case: 15.28-primitive-16
?: forms a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-primitive-16 { ?: forms a constant expression } {
    
    constant_expression T1528p16 {true ? true : false}

} {PASS}
Test Case: 15.28-primitive-17
unused portion of ?: must still be a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-primitive-17 { unused portion of ?: must still
        be a constant expression } {
    
    empty_main T1528p17 {
        int i1 = 1, i2 = 2;
        switch (args.length) {
            case 0:
            case (true ? 1 : i1):
            case (false ? i2 : 2):
        }
    }

} {FAIL}
Test Case: 15.28-simple-name-1
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-1 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sn1 {
        static final int i = 1;
        void foo (int j) {
            switch (j) {
                case i:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-2
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-2 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sn2 {
        final int i = 1;
        void foo (int j) {
            switch (j) {
                case i:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-3
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-3 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sn3 {
        void foo (int j) {
            final int i = 1;
            switch (j) {
                case i:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-4
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-4 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sn4 {
        static final int i = 1 + 1;
        void foo (int j) {
            switch (j) {
                case i:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-5
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-5 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sn5 {
        final int i = 1 - 1;
        void foo (int j) {
            switch (j) {
                case i:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-6
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-6 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sn6 {
        void foo (int j) {
            final int i = true ? 1 : 0;
            switch (j) {
                case i:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-7
a final variable initialized by a final variable that is initialized by constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-7 { a final variable initialized
        by a final variable that is initialized by constant expression
        is a constant expression } {
    
    empty_class T1528sn7 {
        static final int i1 = 1;
        static final int i2 = i1;
        void foo (int j) {
            switch (j) {
                case i2:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-8
a final variable initialized by a final variable that is initialized by constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-8 { a final variable initialized
        by a final variable that is initialized by constant expression
        is a constant expression } {
    
    empty_class T1528sn8 {
        final int i1 = 2 / 1;
        final int i2 = i1;
        void foo (int j) {
            switch (j) {
                case i2:
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-name-9
a final variable initialized by a final variable that is initialized by constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-name-9 { a final variable initialized
        by a final variable that is initialized by constant expression
        is a constant expression } {
    
    empty_class T1528sn9 {
        void foo (int j) {
            final int i1 = 2 * 2;
            final int i2 = i1;
            switch (j) {
                case i2:
            }
        }
    }

} {PASS}
Test Case: 15.28-nonconst-simple-name-1
a non-final variable initialized by a constant expression is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-name-1 { a non-final variable initialized
        by a constant expression is not a constant expression } {
    
    empty_class T1528nsn1 {
        int i = 1;
        void foo (int j) {
            switch (j) {
                case i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-name-2
a final variable initialized by a non-final variable is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-name-2 { a final variable initialized
        by a non-final variable is not a constant expression } {
    
    empty_class T1528nsn2 {
        int i1 = 1;
        final int i2 = i1;
        void foo (int j) {
            switch (j) {
                case i2:
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-name-3
a final variable initialized by a non-constant expression is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-name-3 { a final variable initialized
        by a non-constant expression is not a constant expression } {
    
    empty_class T1528nsn3 {
        int i1 = 0;
        final int i2 = i1++;
        void foo (int j) {
            switch (j) {
                case i2:
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-name-4
an argument variable with the final modifier is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-name-4 { an argument variable with
        the final modifier is not a constant expression } {
    
    empty_class T1528nsn4 {
        void foo (final int i) {
            switch (i) {
                case i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-name-5
a final variable initialized by an argument variable with the final modifier is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-name-5 { a final variable initialized by
        an argument variable with the final modifier is not a constant expression } {
    
    empty_class T1528nsn5 {
        void foo (final int i) {
            final int j = i;
            switch (i) {
                case j:
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-name-6
a final variable initialized by a function invocation is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-name-6 { a final variable initialized by
        a function invocation is not a constant expression } {
    
    empty_class T1528nsn6 {
        void foo (int i) {
            final int j = Integer.parseInt("1");
            switch (i) {
                case j:
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-name-7
a final variable initialized by a ternary conditional operator with a non-constant value is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-name-7 { a final variable initialized by
        a ternary conditional operator with a non-constant value is not
        a constant expression } {
    
    empty_class T1528nsn7 {
        void foo (int i) {
            final int j = true ? 1 : Integer.parseInt("1");
            switch (i) {
                case j:
            }
        }
    }

} {FAIL}
Test Case: 15.28-uninitialized-simple-name-1
a final variable that does not have an initializer is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-uninitialized-simple-name-1 { a final variable that does
        not have an initializer is not a constant expression } {
    
    empty_class T1528usn1 {
        static final int i;
        static { i = 1; }
        void foo (int j) {
            switch (j) {
                case i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-uninitialized-simple-name-2
a final variable that does not have an initializer is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-uninitialized-simple-name-2 { a final variable that does
        not have an initializer is not a constant expression } {
    
    empty_class T1528usn2 {
        static final int i;
        static { i = Integer.parseInt("1"); }
        void foo (int j) {
            switch (j) {
                case i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-uninitialized-simple-name-3
a final variable that does not have an initializer is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-uninitialized-simple-name-3 { a final variable that does
        not have an initializer is not a constant expression } {
    
    empty_class T1528usn3 {
        void foo (int j) {
            final int i;
            i = 1;
            switch (j) {
                case i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-uninitialized-simple-name-4
a final variable that does not have an initializer is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-uninitialized-simple-name-4 { a final variable that does
        not have an initializer is not a constant expression } {
    
    empty_class T1528usn4 {
        void foo (int j) {
            final int i;
            i = Integer.parseInt("1");
            switch (j) {
                case i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-cast-simple-name-1
a final variable initialized by a constant expression and then cast to a primitive is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-cast-simple-name-1 { a final variable initialized
        by a constant expression and then cast to a primitive is a
        constant expression } {
    
    empty_class T1528csn1 {
        final long l1 = 1L;
        final long l2 = Long.MAX_VALUE;
        void foo (int j) {
            switch (j) {
                case (int) l1:
                case (int) l2:
            }
        }
    }

} {PASS}
Test Case: 15.28-cast-simple-name-2
a final variable initialized by a constant expression and then cast to a primitive is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-cast-simple-name-2 { a final variable initialized
        by a constant expression and then cast to a primitive is a
        constant expression } {
    
    empty_class T1528csn2 {
        final boolean t = true;
        void foo (int j) {
            switch (j) {
                case 0:
                case ((boolean) t ? 1 : 0):
            }
        }
    }

} {PASS}
Test Case: 15.28-cast-simple-name-3
any number of casts can be applied to a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-cast-simple-name-3 { any number of casts
        can be applied to a constant expression } {
    
    empty_class T1528csn3 {
        final byte b = (byte) (float) 1.0D;
        final char c = (char) b;
        final short s = (short) c;
        final int i = (int) s;
        final long l = (long) i;
        void foo (int j) {
            switch (j) {
                case 0:
                case (((double) l == 1.0D) ? (int) l : 0):
                case 2:
            }
        }
    }

} {PASS}
Test Case: 15.28-qualified-name-1
qualified references of final constant fields are constant

Expected Result: PASS

Regression Test:

tcltest::test 15.28-qualified-name-1 { qualified references
        of final constant fields are constant } {
    
    empty_class T1528qn1 {
        static final int i = 1;
        void foo(int j) {
            switch (j) {
                case T1528qn1.i:
                case Integer.MAX_VALUE:
            }
        }
    }

} {PASS}
Test Case: 15.28-qualified-name-2
qualified references of final constant fields are constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-2 { qualified references
        of final constant fields are constant } {
    
    empty_class T1528qn2 {
        static int i = 1;
        void foo(int j) {
            switch (j) {
                case T1528qn2.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-3
qualified references of final constant fields are constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-3 { qualified references
        of final constant fields are constant } {
    
    empty_class T1528qn3 {
        static int i = 1;
        static final int i1 = i;
        void foo(int j) {
            switch (j) {
                case T1528qn3.i1:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-4
qualified references of final constant fields are constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-4 { qualified references
        of final constant fields are constant } {
    
    empty_class T1528qn4 {
        static final int i;
        static {i = 1;}
        void foo(int j) {
            switch (j) {
                case T1528qn4.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-5
qualified references of final constant fields must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-5 { qualified references
        of final constant fields must fit the form TypeName.Identifier } {
    
    empty_class T1528qn5 {
        static final T1528qn5 t = new T1528qn5();
        final int i = 1;
        void foo(int j) {
            switch (j) {
                case T1528qn5.t.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-6
qualified references of final constant fields must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-6 { qualified references
        of final constant fields must fit the form TypeName.Identifier } {
    
    empty_class T1528qn6 {
        static final T1528qn6 t = new T1528qn6();
        final int i = 1;
        void foo(int j) {
            switch (j) {
                case t.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-7
qualified references of final constant fields must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-7 { qualified references
        of final constant fields must fit the form TypeName.Identifier } {
    
    empty_class T1528qn7 {
        static final T1528qn7 t = new T1528qn7();
        final int i = 1;
        void foo(int j) {
            switch (j) {
                case T1528qn7.t.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-8
qualified references of final constant fields must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-8 { qualified references
        of final constant fields must fit the form TypeName.Identifier } {
    
    empty_class T1528qn8 {
        static final T1528qn8 t = new T1528qn8();
        static final int i = 1;
        void foo(int j) {
            switch (j) {
                case t.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-9
qualified references of final constant fields must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-9 { qualified references
        of final constant fields must fit the form TypeName.Identifier } {
    
    empty_class T1528qn9 {
        static final int i = 1;
        void foo(int j) {
            final T1528qn9 t = new T1528qn9();
            switch (j) {
                case t.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-name-10
qualified references of final constant fields must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-name-10 { qualified references
        of final constant fields must fit the form TypeName.Identifier } {
    
    empty_class T1528qn10 {
        final int i = 1;
        void foo(int j) {
            final T1528qn10 t = new T1528qn10();
            switch (j) {
                case t.i:
            }
        }
    }

} {FAIL}
Test Case: 15.28-string-1
literals are constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-1 { literals are constant expressions } {
    
    constant_expression T1528s1 {"" == ""} {"hello, world" == "hello, world"}

} {PASS}
Test Case: 15.28-string-2
literals are constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-2 { literals are constant expressions } {
    
    constant_expression T1528s2 {"" + 1 == "1"}  {"" + 1L == "1"}  {"" + 1f == "1.0"}  {"" + 1.0 == "1.0"}  {"" + '1' == "1"}  {"" + true == "true"}

} {PASS}
Test Case: 15.28-string-3
casts to type String are constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-3 { casts to type String are
        constant expressions } {
    
    constant_expression T1528s3 {(String) "" == ""}

} {PASS}
Test Case: 15.28-string-4
casts to primitive types are constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-4 { casts to primitive types are
        constant expressions } {
    
    constant_expression T1528s3 {"" + (boolean) true == "true"}  {"" + (int) 1.5 == "1"}

} {PASS}
Test Case: 15.28-string-5
Unary +, -, ~, ! form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-5 { Unary +, -, ~, ! form constant expressions } {
    
    constant_expression T1528s5 {"" + +2 == "2"} {"" + -0x80000000 == "-2147483648"}  {"" + ~0 == "-1"}  {"" + !false == "true"}

} {PASS}
Test Case: 15.28-string-6
*, /, and % form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-6 { *, /, and % form constant expressions } {
    
    constant_expression T1528s6 {"" + 5 * 3 == "15"}  {"" + 5 / 3 == "1"}  {"" + 5 % 3 == "2"}

} {PASS}
Test Case: 15.28-string-7
String + forms constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-7 { String + forms constant expressions } {
    
    constant_expression T1528s7 {"" + "test" + "ing" == "testing"}  {"a" + "b" == "\u0061b"}

} {PASS}
Test Case: 15.28-string-8
+ and - form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-8 { + and - form constant expressions } {
    
    constant_expression T1528s8 {"" + (1 + 2) == "3"}  {"" + (1 - 2) == "-1"}

} {PASS}
Test Case: 15.28-string-9
<<, >>, and >>> form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-9 { <<, >>, and >>> form constant expressions } {
    
    constant_expression T1528s9 {"" + (2 << 1) == "4"}  {"" + (2 >> 1) == "1"}  {"" + (-2 >>> 1) == "2147483647"}

} {PASS}
Test Case: 15.28-string-10
<, <=, >, and >= form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-10 { <, <=, >, and >= form constant expressions} {
    
    constant_expression T1528s10 {"" + (1 < 2) == "true"}  {"" + (2 <= 2) == "true"}  {"" + (2 > 1) == "true"}  {"" + (1 >= 1) == "true"}

} {PASS}
Test Case: 15.28-string-11
== and != form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-11 { == and != form constant expressions } {
    
    constant_expression T1528s11 {"1" == "1"} {"1" != "2"}

} {PASS}
Test Case: 15.28-string-12
bitwise &, ^, and | form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-12 { bitwise &, ^, and | form constant expressions } {
    
    constant_expression T1528s12 {"" + (0xaa & 0xa5) == "160"}  {"" + (0xaa ^ 0xa5) == "15"}  {"" + (0xaa | 0xa5) == "175"}

} {PASS}
Test Case: 15.28-string-13
logical &, ^, and | form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-13 { logical &, ^, and | form constant expressions} {
    
    constant_expression T1528s13 {"" + (true & true) == "true"}  {"" + (true ^ false) == "true"}  {"" + (false | true) == "true"}

} {PASS}
Test Case: 15.28-string-14
&& and || form constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-14 { && and || form constant expressions } {
    
    constant_expression T1528s14 {"" + (true && true) == "true"}  {"" + (true || false) == "true"}

} {PASS}
Test Case: 15.28-string-15
?: forms constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-15 { ?: forms constant expressions } {
    
    constant_expression T1528s15 {"" + (true ? 1 : 2) == "1"}

} {PASS}
Test Case: 15.28-string-16
?: forms constant expressions

Expected Result: PASS

Regression Test:

tcltest::test 15.28-string-16 { ?: forms constant expressions } {
    
    constant_expression T1528s16 {(true ? "1" : "") == "1"}

} {PASS}
Test Case: 15.28-string-17
instanceof does not form a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-string-17 { instanceof does not form a constant expression } {
    
    constant_expression T1528s17 {"" instanceof String}

} {FAIL}
Test Case: 15.28-simple-namestr-1
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-namestr-1 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sns1 {
        void foo (int j) {
            final String s = "1";
            switch (j) {
                case 0:
                case ((s == "1") ? 1 : 0):
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-namestr-2
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-namestr-2 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sns2 {
        void foo (int j) {
            final String s = "1" + "2";
            switch (j) {
                case 0:
                case ((s == "12") ? 1 : 0):
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-namestr-3
a final variable initialized by a constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-namestr-3 { a final variable initialized
        by a constant expression is a constant expression } {
    
    empty_class T1528sns3 {
        void foo (int j) {
            final String s = "1" + (int) 2.0D;
            switch (j) {
                case 0:
                case ((s == "12") ? 1 : 0):
            }
        }
    }

} {PASS}
Test Case: 15.28-simple-namestr-4
a final variable initialized by a final variable that is initialized by constant expression is a constant expression

Expected Result: PASS

Regression Test:

tcltest::test 15.28-simple-namestr-4 { a final variable initialized
        by a final variable that is initialized by constant expression
        is a constant expression } {
    
    empty_class T1528sns4 {
        void foo (int j) {
            final String s1 = "1";
            final String s2 = s1;
            switch (j) {
                case 0:
                case ((s2 == "1") ? 1 : 0):
            }
        }
    }

} {PASS}
Test Case: 15.28-nonconst-simple-namestr-1
a non-final variable initialized by a constant expression is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-namestr-1 { a non-final variable initialized
        by a constant expression is not a constant expression } {
    
    empty_class T1528nsns1 {
        String s = "1";
        void foo (int j) {
            switch (j) {
                case 0:
                case ((s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-namestr-2
a final variable initialized by a non-final variable is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-namestr-2 { a final variable initialized
        by a non-final variable is not a constant expression } {
    
    empty_class T1528nsns2 {
        String s1 = "1";
        final String s2 = s1;
        void foo (int j) {
            switch (j) {
                case 0:
                case ((s2 == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-nonconst-simple-namestr-3
a final variable initialized by a function invocation is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-nonconst-simple-namestr-3 { a final variable initialized
        by a function invocation is not a constant expression } {
    
    empty_class T1528nsns3 {
        final String s = String.valueOf(0L);
        void foo (int j) {
            switch (j) {
                case 0:
                case ((s == "0") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-1
qualified references of final constant fields are constant

Expected Result: PASS

Regression Test:

tcltest::test 15.28-qualified-namestr-1 { qualified
        references of final constant fields are constant } {
    
    empty_class T1528qns1 {
        static final String s = "1";
        void foo(int j) {
            switch (j) {
                case 0:
                case ((T1528qns1.s == "1") ? 1 : 0):
            }
        }
    }

} {PASS}
Test Case: 15.28-qualified-namestr-2
qualified references of final constant fields are constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-2 { qualified
        references of final constant fields are constant } {
    
    empty_class T1528qns2 {
        static String s = "1";
        void foo(int j) {
            switch (j) {
                case 0:
                case ((T1528qns2.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-3
qualified references of final constant fields are constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-3 { qualified
        references of final constant fields are constant } {
    
    empty_class T1528qns3 {
        static String s = "1";
        static final String s1 = s;
        void foo(int j) {
            switch (j) {
                case 0:
                case ((T1528qns3.s1 == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-4
qualified references of final constant fields are constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-4 { qualified
        references of final constant fields are constant } {
    
    empty_class T1528qns4 {
        static final String s;
        static {s = "1";}
        void foo(int j) {
            switch (j) {
                case 0:
                case ((T1528qns4.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-5
qualified references of final constant must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-5 { qualified references
        of final constant must fit the form TypeName.Identifier } {
    
    empty_class T1528qns5 {
        static final T1528qns5 t = new T1528qns5();
        final String s = "1";
        void foo(int j) {
            switch (j) {
                case 0:
                case ((T1528qns5.t.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-6
qualified references of final constant must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-6 { qualified references
        of final constant must fit the form TypeName.Identifier } {
    
    empty_class T1528qns6 {
        static final T1528qns6 t = new T1528qns6();
        final String s = "1";
        void foo(int j) {
            switch (j) {
                case 0:
                case ((t.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-7
qualified references of final constant must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-7 { qualified references
        of final constant must fit the form TypeName.Identifier } {
    
    empty_class T1528qns7 {
        static final T1528qns7 t = new T1528qns7();
        static final String s = "1";
        void foo(int j) {
            switch (j) {
                case 0:
                case ((t.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-8
qualified references of final constant must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-8 { qualified references
        of final constant must fit the form TypeName.Identifier } {
    
    empty_class T1528qns8 {
        static final T1528qns8 t = new T1528qns8();
        static final String s = "1";
        void foo(int j) {
            switch (j) {
                case 0:
                case ((t.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-9
qualified references of final constant must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-9 { qualified references
        of final constant must fit the form TypeName.Identifier } {
    
    empty_class T1528qns9 {
        static final String s = "1";
        void foo(int j) {
            final T1528qns9 t = new T1528qns9();
            switch (j) {
                case 0:
                case ((t.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-qualified-namestr-10
qualified references of final constant must fit the form TypeName.Identifier

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-qualified-namestr-10 { qualified references
        of final constant must fit the form TypeName.Identifier } {
    
    empty_class T1528qns10 {
        final String s = "1";
        void foo(int j) {
            final T1528qns10 t = new T1528qns10();
            switch (j) {
                case 0:
                case ((t.s == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-notstring-1
casting a String to anything other than string makes is not a constant expression, casting back to String does not reverse the process

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-notstring-1 { casting a String to anything
        other than string makes is not a constant expression,
        casting back to String does not reverse the process } {
    
    constant_expression T1528nots1 {(String) (Object) "" == ""}

} {FAIL}
Test Case: 15.28-notstring-2
anything other than type String is not a constant expression

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-notstring-2 { anything other than type String
        is not a constant expression } {
    
    empty_class T1528nots2 {
        final Object o = "1";
        void foo (int j) {
            switch (j) {
                case 0:
                case ((o == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-notstring-3
anything other than type String is not a constant expression, casting to String does not help

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-notstring-3 { anything other than type String
        is not a constant expression, casting to String does not help } {
    
    empty_class T1528nots3 {
        final Object o = "1";
        void foo (int j) {
            switch (j) {
                case 0:
                case (((String) o == "1") ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-null-1
The null literal is NOT a compile-time constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-null-1 { The null literal is NOT a compile-time constant } {
    
    constant_expression T1528null1 {null == null}

} {FAIL}
Test Case: 15.28-null-2
The null literal is NOT a compile-time constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-null-2 { The null literal is NOT a compile-time constant } {
    
    constant_expression T1528null2 {null != ""}

} {FAIL}
Test Case: 15.28-null-3
The null literal is NOT a compile-time constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-null-3 { The null literal is NOT a compile-time constant } {
    
    constant_expression T1528null3 {"" + null == "null"}

} {FAIL}
Test Case: 15.28-null-4
The null literal is NOT a compile-time constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-null-4 { The null literal is NOT a compile-time constant } {
    
    constant_expression T1528null4 {(String)null + (String)null == "nullnull"}

} {FAIL}
Test Case: 15.28-null-5
The null literal is NOT a compile-time constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-null-5 { The null literal is NOT a compile-time constant } {
    
    empty_class T1528null5 {
        static final String s = null;
        void foo(int i) {
            switch (i) {
                case 0:
                case (("" != s) ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-null-6
The null literal is NOT a compile-time constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-null-6 { The null literal is NOT a compile-time constant } {
    
    empty_class T1528null6 {
        void foo(int i) {
            final String s = null;
            switch (i) {
                case 0:
                case (("" != s) ? 1 : 0):
            }
        }
    }

} {FAIL}
Test Case: 15.28-null-7
The null literal is NOT a compile-time constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-null-7 { The null literal is NOT a compile-time constant } {
    
    constant_expression T1528null7 {"" + (true ? null : null) == "null"}

} {FAIL}
Test Case: 15.28-example-1
Example constants

Expected Result: PASS

Regression Test:

tcltest::test 15.28-example-1 { Example constants } {
    
    constant_expression T1528e1 {true} {(short)(1*2*3*4*5*6) == 720}  {Integer.MAX_VALUE / 2 == 0x3fffffff}  {2.0 * Math.PI == 6.283185307179586}

} {PASS}
Test Case: 15.28-example-2
Example constant

Expected Result: PASS

Regression Test:

tcltest::test 15.28-example-2 { Example constant } {
    
    constant_expression T1528e2 {"The integer " + Long.MAX_VALUE +
    " is mighty big." == "The integer 9223372036854775807 is mighty big."}

} {PASS}
Test Case: 15.28-instanceof-1
The expression argument of instanceof may be constant

Expected Result: FAIL

Regression Test:

tcltest::test 15.28-instanceof-1 { The expression argument of instanceof may be constant } {
    
    constant_expression T1528i1 {null instanceof Object}

} {FAIL}

16.2.7

Directory : tests/jls/definite-assignment/statements/if-statements


Test Case: 16.2.7-final-1
A blank final initialized inside an if (true) block is definitely assigned.

Expected Result: PASS

Regression Test:

tcltest::test 16.2.7-final-1 { A blank final
        initialized inside an if (true) block is
        definitely assigned. } {
    

    compile [saveas T1627f1.java {
public class T1627f1 {
    final int val;

    T1627f1() {
        if (true) {
            val = 1;
        }
    }
}
}]

} {PASS}
Test Case: 16.2.7-final-2
A blank final initialized inside an if (false) block is not definitely assigned.

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.7-final-2 { A blank final
        initialized inside an if (false) block is
        not definitely assigned. } {
    

    compile [saveas T1627f2.java {
public class T1627f2 {
    final int val;

    T1627f2() {
        if (false) {
            val = 0;
        }
    }
}
}]

} {FAIL}
Test Case: 16.2.7-final-3
A final variable must be definitely unassigned if it is to be assigned inside an if (true) block.

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.7-final-3 { A final variable
        must be definitely unassigned if it
        is to be assigned inside an if (true) block. } {
    

    compile [saveas T1627f3.java {

public class T1627f3 {
    final int val = 0;

    T1627f3() {
        if (true) {
            val = 1;
        }
    }
}
}]

} {FAIL}
Test Case: 16.2.7-final-4
A final variable must be definitely unassigned if it is to be assigned inside an if (false) block.

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.7-final-4 { A final variable
        must be definitely unassigned if it
        is to be assigned inside an if (false) block. } {
    

    compile [saveas T1627f4.java {
public class T1627f4 {
    final int val = 0;

    T1627f4() {
        if (false) {
            val = 1;
        }
    }
}
}]

} {FAIL}
Test Case: 16.2.7-final-5
A final variable must be definitely unassigned when an assignment to it occurs. A blank final assigned inside an if (true) block is definitely assigned, so a second assignment fails.

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.7-final-5 { A final variable
        must be definitely unassigned when an
        assignment to it occurs. A blank
        final assigned inside an if (true)
        block is definitely assigned, so
        a second assignment fails. } {
    

    compile [saveas T1627f5.java {
public class T1627f5 {
    final int val;

    T1627f5() {
        if (true) {
            val = 1;
        }

        val = 0;
    }
}
}]

} {FAIL}
Test Case: 16.2.7-final-6
A final variable must be definitely unassigned when an assignment to it occurs. A blank final assigned inside an if (false) block is not definitely assigned but it is also not definitely unassigned.

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.7-final-6 { A final variable
        must be definitely unassigned when an
        assignment to it occurs. A blank
        final assigned inside an if (false)
        block is not definitely assigned but
        it is also not definitely unassigned. } {
    

    compile [saveas T1627f6.java {
public class T1627f6 {
    final int val;

    T1627f6() {
        if (false) {
            val = 1;
        }

        val = 0;
    }
}
}]

} {FAIL}
Test Case: 16.2.7-scope-1
A final variable in one scope should not effect a final variable in the enclosing scope

Expected Result: PASS

Regression Test:

tcltest::test 16.2.7-scope-1 { A final variable in
        one scope should not effect a final variable
        in the enclosing scope } {
    

    empty_main T1627s1 {
        if (true) {
          final int i = 1;
        }
        final int j;
        j = 2;
    }

} {PASS}
Test Case: 16.2.7-scope-2
A final variable in one scope should not effect a final variable in the enclosing scope

Expected Result: PASS

Regression Test:

tcltest::test 16.2.7-scope-2 { A final variable in
        one scope should not effect a final variable
        in the enclosing scope } {
    

    empty_main T1627s2 {
        if (true) {
          final int i = 1;
        }
        final int i;
        i = 2;
    }

} {PASS}

16.2.8

Directory : tests/jls/definite-assignment/statements/switch-statements


Test Case: 16.2.8-final-1
A blank final may be assigned in different block statement groups, provided it not assigned twice

Expected Result: PASS

Regression Test:

tcltest::test 16.2.8-final-1 { A blank final may be assigned in different block
        statement groups, provided it not assigned twice } {
    
    switch_labels T1628f1 int {
            case 0:
                final byte b = 0;
                break;
            case 1:
                b = 1;
    }

} {PASS}
Test Case: 16.2.8-final-2
A final may be assigned in different block statement groups, provided it not assigned twice

Expected Result: PASS

Regression Test:

tcltest::test 16.2.8-final-2 { A final may be assigned in different block
        statement groups, provided it not assigned twice } {
    
    switch_labels T1628f2 int {
            case 0:
                final int b;
                b = 0;
                break;
            case 1:
                b = 1;
    }

} {PASS}
Test Case: 16.2.8-final-3
A final may be assigned in different block statement groups, provided it not assigned twice. The variable is assigned if the case block falls through after an assignment

Expected Result: PASS

Regression Test:

tcltest::test 16.2.8-final-3 { A final may be assigned in different block
        statement groups, provided it not assigned twice. The variable
        is assigned if the case block falls through after an assignment } {
    
    switch_labels T1628f3 int {
            case 0:
                final byte b = 0;
                break;
            case 1:
                b = 1;
            case 2:
                byte c = b;
    }

} {PASS}
Test Case: 16.2.8-unassigned-1
A variable must have been assigned in each switch block if it is going to be accessed

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.8-unassigned-1 { A variable must have been assigned
        in each switch block if it is going to be accessed } {
    

    switch_labels T1628u1 int {
            case 0:
                byte b = 0;
                break;
            default:
                b++;
    }

} {FAIL}
Test Case: 16.2.8-unassigned-2
A variable that is not definitely assigned before entering the switch must be definitely assigned in each switch block if it is to be definitely assigned after the switch block

Expected Result: PASS

Regression Test:

tcltest::test 16.2.8-unassigned-2 { A variable that is not definitely assigned
        before entering the switch must be definitely assigned in each switch
        block if it is to be definitely assigned after the switch block } {
    

    compile [saveas T1628u2.java {
class T1628u2 {
    void foo(int i) {
        int j;
        switch (i) {
            case 0: j = 0; break;
            case 1: j = 1; break;
            default: j = 2; break;
        }
        j++;
    }
}
    }]

} {PASS}
Test Case: 16.2.8-unassigned-3
A variable that is not definitely assigned before entering the switch must be definitely assigned in each switch block if it is to be definitely assigned after the switch block

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.8-unassigned-3 { A variable that is not definitely assigned
        before entering the switch must be definitely assigned in each switch
        block if it is to be definitely assigned after the switch block } {
    

    compile [saveas T1628u3.java {
class T1628u3 {
    void foo(int i) {
        int j;
        switch (i) {
            case 0: j = 0; break;
            case 1: break;
            default: j = 2; break;
        }
        j++;
    }
}
    }]

} {FAIL}
Test Case: 16.2.8-unassigned-4
A variable that is not definitely assigned before entering the switch must be definitely assigned in each switch block (including the default block) if it is to be definitely assigned after the switch block

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.8-unassigned-4 { A variable that is not definitely assigned
        before entering the switch must be definitely assigned in each switch
        block (including the default block) if it is to be definitely assigned
        after the switch block } {
    

    compile [saveas T1628u4.java {
class T1628u4 {
    void foo(int i) {
        int j;
        switch (i) {
            case 0: j = 0; break;
            case 1: j = 0; break;
        }
        j++;
    }
}
    }]

} {FAIL}
Test Case: 16.2.8-unassigned-5
Switch blocks that fall through to default: that definitely assigns a variable ensures that the variable is definitely assigned after the switch

Expected Result: PASS

Regression Test:

tcltest::test 16.2.8-unassigned-5 { Switch blocks that fall through to default:
        that definitely assigns a variable ensures that the variable is
        definitely assigned after the switch } {
    

    compile [saveas T1628u5.java {
class T1628u5 {
    void foo(int i) {
        int j;
        switch (i) {
            case 0:
            case 1:
            default: j = 0;
        }
        j++;
    }
}
    }]

} {PASS}
Test Case: 16.2.8-unassigned-6
A final local variable within a switch statement can't be used in a switch label, since it must be treated as a blank final in each switch block

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.8-unassigned-6 { A final local variable within a
        switch statement can't be used in a switch label, since
        it must be treated as a blank final in each switch block } {
    
    switch_labels T1628u6 int {
            case 0:
                final byte b = 1;
                break;
            case b:
    }

} {FAIL}
Test Case: 16.2.8-unassigned-7
A final local variable scoped to the switch statement can't be used as a case label because it is unassigned when the switch statement is entered. This test might incorrectly pass if the compiler returns FAIL because of the second assignment to b.

Expected Result: FAIL

Regression Test:

tcltest::test 16.2.8-unassigned-7 { A final local variable scoped to the
        switch statement can't be used as a case label because it is
        unassigned when the switch statement is entered. This test
        might incorrectly pass if the compiler returns FAIL because
        of the second assignment to b. } {
    
    switch_labels T1628u7 int {
            case 0:
                final byte b = 1;
                break;
            case b:
                b = 0;
    }

} {FAIL}

runtime tests


3.10.5

Directory : tests/runtime/jls/lexical-structure/literals/string-literals


Test Case: 3.10.5-runtime-1
Compile-time constant string expressions, and String.intern(), are == String objects

Expected Result: true true true true false true

Regression Test:

tcltest::test 3.10.5-runtime-1 { Compile-time constant string
        expressions, and String.intern(), are == String objects
        } {
    
    saveas testPackage/T3105r1.java {
package testPackage;
  class T3105r1 {
      public static void main(String[] args) {   
        String hello = "Hello", lo = "lo";
        System.out.print((hello == "Hello") + " ");
        System.out.print((Other1.hello == hello) + " ");
        System.out.print((other.Other.hello == hello) + " ");
        System.out.print((hello == ("Hel"+"lo")) + " ");
        System.out.print((hello == ("Hel"+lo)) + " ");
        System.out.print(hello == ("Hel"+lo).intern());
      }
}
class Other1 { static String hello = "Hello"; }
    }

    saveas other/Other.java {
package other;
public class Other { public static String hello = "Hello"; }
    }

    compile_and_run other/Other.java testPackage/T3105r1.java

} {true true true true false true}
Test Case: 3.10.5-runtime-2
Strings that occupy more than 0xffff UTF8 bytes cannot be constant, according to JVMS. However, since the JLS does not require compile-time failure, we must also test for an invalid constant pool entry

Expected Result: OK

Regression Test:

tcltest::test 3.10.5-runtime-2 { Strings that occupy more than 0xffff UTF8
        bytes cannot be constant, according to JVMS.  However, since the
        JLS does not require compile-time failure, we must also test for
        an invalid constant pool entry } {
    
    compile_and_run [saveas T3105r2.java {
class T3105r2 {
    static final String s0001 = "a";
    static final String s0002 = s0001 + s0001;
    static final String s0004 = s0002 + s0002;
    static final String s0008 = s0004 + s0004;
    static final String s0010 = s0008 + s0008;
    static final String s0020 = s0010 + s0010;
    static final String s0040 = s0020 + s0020;
    static final String s0080 = s0040 + s0040;
    static final String s0100 = s0080 + s0080;
    static final String s0200 = s0100 + s0100;
    static final String s0400 = s0200 + s0200;
    static final String s0800 = s0400 + s0400;
    static final String s1000 = s0800 + s0800;
    static final String s2000 = s1000 + s1000;
    static final String s4000 = s2000 + s2000;
    static final String s8000 = s4000 + s4000;
    static final String sffff = s8000 + s4000 + s2000 + s1000
                              + s0800 + s0400 + s0200 + s0100
                              + s0080 + s0040 + s0020 + s0010
                              + s0008 + s0004 + s0002 + "b"; // still constant!

    static final String toobig = sffff + "c"; // can't be constant

    public static void main(String[] args) {
        if (toobig.equals(""))
            System.out.println("String was lost completely");
        else if (toobig.endsWith("b"))
            System.out.println("String was truncated at 0xffff bytes");
        else if (toobig.endsWith("abc")) {
            String alternate = sffff;
            alternate += "c";
            alternate = alternate.intern();
            if (alternate != toobig)
                System.out.println("String was not interned");
            else
                System.out.println("OK");
        } else
            System.out.println("Unexpected case");            
    }
}
    }]

} {OK}

8.8.7

Directory : tests/runtime/jls/classes/constructor-declarations/default-constructor


Test Case: 8.8.7-runtime-default-1
If a class contains no constructor declarations, then a default constructor that takes no parameters and invokes the superclass constructor with no arguments is provided

Expected Result: super main

Regression Test:

tcltest::test 8.8.7-runtime-default-1 { If a class
        contains no constructor declarations,
        then a default constructor that takes
        no parameters and invokes the superclass
        constructor with no arguments is provided } {
    

    saveas T887rd1.java {
class  T887rd1_super {
    T887rd1_super() { System.out.print("super "); }
}
public class T887rd1 extends T887rd1_super {
    public static void main(String[] argv) {
        new T887rd1();
        System.out.print("main");
    }
}
    }

    compile_and_run T887rd1.java

} {super main}
Test Case: 8.8.7-runtime-default-2
If a class contains no constructor declarations, then a default constructor that takes no parameters and invokes the superclass constructor with no arguments is provided

Expected Result: super super main

Regression Test:

tcltest::test 8.8.7-runtime-default-2 { If a class
        contains no constructor declarations,
        then a default constructor that takes
        no parameters and invokes the superclass
        constructor with no arguments is provided } {
    

    saveas T887rd2.java {
class  T887rd2_super {
    T887rd2_super() { System.out.print("super "); }
}
public class T887rd2 extends T887rd2_super {
    public static void main(String[] argv) {
        new T887rd2().toString();
        (new T887rd2()).toString();
        System.out.print("main");
    }
}
    }

    compile_and_run T887rd2.java

} {super super main}
Test Case: 8.8.7-runtime-default-3
If a class contains no constructor declarations, then a default constructor that takes no parameters and invokes the superclass constructor with no arguments is provided

Expected Result: super + super main

Regression Test:

tcltest::test 8.8.7-runtime-default-3 { If a class
        contains no constructor declarations,
        then a default constructor that takes
        no parameters and invokes the superclass
        constructor with no arguments is provided } {
    

    saveas T887rd3.java {
class  T887rd3_super {
    T887rd3_super() { System.out.print("super "); }
}
public class T887rd3 {

    private static class Inner extends T887rd3_super {}

    public static void main(String[] argv) {
        new Inner().toString();
        System.out.print("+ ");
        (new Inner()).toString();
        System.out.print("main");
    }
}
    }

    compile_and_run T887rd3.java

} {super + super main}

12.5

Directory : tests/runtime/jls/execution/creation-of-new-class-instances


Test Case: 12.5-runtime-1
Variable initializers are executed after the explicit or implicit superclass constructor, but before all other statements of the constructor

Expected Result: A 1 1

Regression Test:

tcltest::test 12.5-runtime-1 { Variable initializers are executed after the
        explicit or implicit superclass constructor, but before all
        other statements of the constructor } {
    
    compile_and_run [saveas T125r1.java {
class Super {
    Super(int x) {
        method(x);
    }

    void method(int x) { }
}
class T125r1 extends Super {
    private int i1 = 1;
    private Integer i2 = new Integer(1);
    void method(int x) {
        i1 = x;
        i2 = new Integer(x);
        System.out.print("A ");
    }
    T125r1() {
        super(2); // superclass calls method()
    }
    public static void main(String[] args) {
        T125r1 t = new T125r1();
        System.out.print(t.i1 + " " + t.i2);
    }
}
    }]

} {A 1 1}
Test Case: 12.5-runtime-2
Example in JLS

Expected Result: 03

Regression Test:

tcltest::test 12.5-runtime-2 { Example in JLS } {
    
    compile_and_run [saveas T125r2.java {
class Super {
    Super() { printThree(); }
    void printThree() { System.out.println("three"); }
}
class T125r2 extends Super {
    int three = (int)Math.PI;  // That is, 3
    public static void main(String[] args) {
        T125r2 t = new T125r2();
        t.printThree();
    }
    void printThree() { System.out.print(three); }
}
    }]

} {03}

14

Directory : tests/runtime/jls/blocks-and-statements


Test Case: 14-runtime-jump-1
Generic test of large goto_w (can occur in for, if, while, do, switch, try, break, and continue)

Expected Result: OK

Regression Test:

tcltest::test 14-runtime-jump-1 { Generic test of large
        goto_w (can occur in for, if, while, do,
        switch, try, break, and continue) } {
    
    set class_data "
class T14rj1 \{
    public static void main(String\[\] args) \{
        int i = 1;
        for (int j = 0; j < 2; j++) \{\n"
    set count 0
    while {$count < 3500} {
        append class_data "\t    i = 366 * i % 534;\n"
        incr count
    }
    append class_data "\t\}
        if (i == 210)
            System.out.print(\"OK\");
        else
            System.out.print(\"FAIL\");
    \}
\}\n"
    compile_and_run [saveas T14rj1.java $class_data]

} {OK}

14.10

Directory : tests/runtime/jls/blocks-and-statements/switch-statement


Test Case: 14.10-runtime-verifier-1
runtime switch test for values between 0x7ffffff0 and 0x7fffffff

Expected Result: OK

Regression Test:

tcltest::test 14.10-runtime-verifier-1 { runtime switch test for values
        between 0x7ffffff0  and 0x7fffffff } {
    
    compile_and_run [saveas T1410v1.java {
class T1410v1 {
  public static void main(String [] args) {
    // prevent compiler optimization of switch by using args.length
    switch (args.length + 0x7ffffff2) {
    case 0x7ffffff0:
    case 0x7ffffff1:
    case 0x7ffffff2:
    case 0x7ffffff3:
      System.out.print("OK");
      break;
    default:
      System.out.print("NOT_OK");
    }
  }
}
    }]

} {OK}
Test Case: 14.10-runtime-fallthrough-1
runtime test for fallthrough of cases

Expected Result: many too many one too many

Regression Test:

tcltest::test 14.10-runtime-fallthrough-1 { runtime test for fallthrough
        of cases } {
    
    compile_and_run [saveas T1410f1.java {
class T1410f1 {
    static void howMany(int k) {
        switch (k) {
            case 1: System.out.print("one ");
            case 2: System.out.print("too ");
            case 3: System.out.println("many");
        }
    }
    public static void main(String[] args) {
        howMany(3);
        howMany(2);
        howMany(1);
    }
}
    }]

} {many
too many
one too many
}
Test Case: 14.10-runtime-fallthrough-2
runtime test for break stopping fallthrough

Expected Result: one two many

Regression Test:

tcltest::test 14.10-runtime-fallthrough-2 { runtime test for break
    stopping fallthrough } {
    
    compile_and_run [saveas T1410f2.java {
class T1410f2 {
    static void howMany(int k) {
        switch (k) {
            case 1: System.out.println("one");
            break;            // exit the switch
            case 2: System.out.println("two");
            break;            // exit the switch
            case 3: System.out.println("many");
            break;            // not needed, but good style
        }
    }
    public static void main(String[] args) {
        howMany(1);
        howMany(2);
        howMany(3);
    }
}
    }]

} {one
two
many
}
Test Case: 14.10-runtime-local-1
in a switch, local finals should behave like blanks, not compile-time constants

Expected Result: 1

Regression Test:

tcltest::test 14.10-runtime-local-1 { in a switch, local finals should
        behave like blanks, not compile-time constants } {
    
    compile_and_run [saveas T1410l1.java {
class T1410l1 {
    public static void main(String[] args) {
        switch (args.length + 1) {
            case 0: final int i = 0; break;
            case 1: i = 1;
                System.out.print(i);
        }
    }
}
    }]

} {1}

14.19.2

Directory : tests/runtime/jls/blocks-and-statements/try-statement/try-catch-finally


Test Case: 14.19.2-runtime-try-1
runtime try catch finally test with synchronize statement

Expected Result: OK

Regression Test:

tcltest::test 14.19.2-runtime-try-1 { runtime try
        catch finally test with synchronize statement } {
    
    compile_and_run [saveas T14192rt1.java {
class T14192rt1 {
    public static void main(String [] args) {
        Object o = new Object();
        try {
            synchronized (o) {
                System.out.print("O");
                return;
            }
        }
        finally {
            try {
                raise();
            }
            catch (Exception e) {
                System.out.print("K");
            }
        }
    }
    public static void raise() throws Exception {
        throw new Exception();
    }
}
    }]

} {OK}
Test Case: 14.19.2-runtime-jump-1
test of jsr_w

Expected Result: OK

Regression Test:

tcltest::test 14.19.2-runtime-jump-1 { test of jsr_w } {
    
    set class_data "
class T14192rj1 \{
    public static void main(String\[\] args) \{
        int i = 1;
        try \{
            if (i == 0)
                throw new Exception();
            return;
        \} catch (Exception e) \{\n"
    set count 0
    while {$count < 3500} {
        append class_data "\t    i = 366 * i % 534;\n"
        incr count
    }
    append class_data "\t\} finally \{
            if (i == 1)
                System.out.print(\"OK\");
            else
                System.out.print(\"FAIL\");
        \}
    \}
\}\n"
    compile_and_run [saveas T14192rj1.java $class_data]

} {OK}

15.9

Directory : tests/runtime/jls/expressions/class-instance-creation


Test Case: 15.9-runtime-numcalls-1
Check the number of times a constructor is called from a class instance creation expression

Expected Result: ctor -> ctor

Regression Test:

tcltest::test 15.9-runtime-numcalls-1 { Check the number
        of times a constructor is called from a class
        instance creation expression } {
    

    compile_and_run [saveas T159rn1.java {
class T159rn1 {

    private static class Inner {
        public Inner() {
            System.err.print("ctor");
        }

        private void foo() {}
    }

    public static void main(String[] args) {
        new Inner().foo();              // broken in Jikes 1.11
        System.err.print(" -> ");
        (new Inner()).foo();            // okay
    }
}
    }]

} {ctor -> ctor}

15.12.3

Directory : tests/runtime/jls/expressions/method-invocation-expressions/chosen-method-appropriate


Test Case: 15.12.3-runtime-mode-1
The invocation mode of a non-static, non-private method is virtual

Expected Result: 3 3

Regression Test:

tcltest::test 15.12.3-runtime-mode-1 { The invocation mode of a non-static,
        non-private method is virtual } {
    
    saveas p1/T15123rm1_1.java {
package p1;
public class T15123rm1_1 {
    protected void foo() { // this is overridden in T15123rm1_3
        System.out.print("1");
    }
}
    }
    saveas p2/T15123rm1_2.java {
package p2;
import p1.*;
public class T15123rm1_2 extends T15123rm1_1 {
    protected void call() {
        foo(); // must be virtual call
        System.out.print(' ');
        new Object() {
            { foo(); } // must be virtual call of enclosing instance
        };
    }
}
    }
    saveas p3/T15123rm1_3.java {
package p3;
import p2.*;
public class T15123rm1_3 extends T15123rm1_2 {
    public static void main(String[] args) {
        new T15123rm1_3().call();
    }
    protected void foo() { // will be called virtually
        System.out.print("3");
    }
}
    }
    compile_and_run -classpath . p1/T15123rm1_1.java p2/T15123rm1_2.java p3/T15123rm1_3.java

} {3 3}

15.14

Directory : tests/runtime/jls/expressions/postfix-expressions


Test Case: 15.14-runtime-1
Postfix ops have higher precedence than prefix

Expected Result: true true true

Regression Test:

tcltest::test 15.14-runtime-1 { Postfix ops have higher precedence
        than prefix } {
    
    compile_and_run [saveas T15141.java {
class T15141 {
    public static void main(String[] args) {
        int a = 1, b = 1;
        System.out.print((-a++ == -1) + " ");
        System.out.print((-(b++) == -1) + " ");
        System.out.print(a == b);
    }
}
    }]

} {true true true}
Test Case: 15.14-runtime-2
Postfix ops have higher precedence than prefix

Expected Result: true true true

Regression Test:

tcltest::test 15.14-runtime-2 { Postfix ops have higher precedence
        than prefix } {
    
    compile_and_run [saveas T15142.java {
class T15142 {
    public static void main(String[] args) {
        int a = 2, b = 2;
        System.out.print((-a-- == -2) + " ");
        System.out.print((-(b--) == -2) + " ");
        System.out.print(a == b);
    }
}
    }]

} {true true true}

15.15

Directory : tests/runtime/jls/expressions/unary-operators


Test Case: 15.15-runtime-1
Prefix ops have higher precedence than multiplicative

Expected Result: true true true

Regression Test:

tcltest::test 15.15-runtime-1 { Prefix ops have higher precedence than
        multiplicative } {
    
    compile_and_run [saveas T15151.java {
class T15151 {
    public static void main(String[] args) {
        int a = 1, b = 1;
        System.out.print((++a*a == 4) + " ");
        System.out.print(((++b)*b == 4) + " ");
        System.out.print(a == b);
    }
}
    }]

} {true true true}
Test Case: 15.15-runtime-2
Prefix ops have higher precedence than multiplicative

Expected Result: true true true

Regression Test:

tcltest::test 15.15-runtime-2 { Prefix ops have higher precedence
        than multiplicative } {
    
    compile_and_run [saveas T15152.java {
class T15152 {
    public static void main(String[] args) {
        int a = 3, b = 3;
        System.out.print((--a*a == 4) + " ");
        System.out.print(((--b)*b == 4) + " ");
        System.out.print(a == b);
    }
}
    }]

} {true true true}

15.18.1.1

Directory : tests/runtime/jls/expressions/additive-operators/string-conversion


Test Case: 15.18.1.1-runtime-1
"" + char[] should behave the same as char[].toString()

Expected Result: OK

Regression Test:

tcltest::test 15.18.1.1-runtime-1 { "" + char[] should behave the
        same as char[].toString() } {
    
    compile_and_run [saveas T151811r1.java {
class T151811r1 {
    public static void main(String args[]) {
	char[] c = {'w','r','o','n','g'};
	String s = "" + c;
	if (s.equals(c.toString()))
    	    System.out.print("OK");
	else
	    System.out.print("WRONG");
    }
}
    }]

} {OK}

15.26.2

Directory : tests/runtime/jls/expressions/assignment-operators/compound-assignment-operators


Test Case: 15.26.2-runtime-1
String += char[] should do same as s += char[].toString()

Expected Result: OK

Regression Test:

tcltest::test 15.26.2-runtime-1 { String += char[] should do
        same as s += char[].toString() } {
    
    compile_and_run [saveas T15262r1.java {
class T15262r1 {
    public static void main(String args[]) {
	String s = "";
	char[] c = {'w','r','o','n','g'};
	s += c;
	if (s.equals(c.toString()))
	    System.out.print("OK");
	else
	    System.out.print("WRONG");
    }
}
    }]

} {OK}

non-jls tests


argument-expansion

Directory : tests/non-jls/argument-expansion


Test Case: non-jls-argument-expansion-1
Under Windows, the compiler should expand command line arguments

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-1 { Under Windows, the compiler
        should expand command line arguments } {
    
    compile *.java

} {PASS}
Test Case: non-jls-argument-expansion-2
The @ symbol indicates that the compiler should read file names from the given file

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-2 { The @ symbol indicates that
        the compiler should read file names from the given file} {
    
    saveas list2 "C1.java"
    compile @list2

} {PASS}
Test Case: non-jls-argument-expansion-3
EOL chars in @ file argument

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-3 { EOL chars in @ file
        argument } {
    
    saveas list3 "C1.java\nC2.java"
    compile @list3

} {PASS}
Test Case: non-jls-argument-expansion-4
EOL chars in @ file argument

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-4 { EOL chars in @ file
        argument } {
    
    saveas list4 "C1.java\r\nC2.java"
    compile @list4

} {PASS}
Test Case: non-jls-argument-expansion-5
EOL chars in @ file argument

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-5 { EOL chars in @ file
        argument } {
    
    saveas list5 "C1.java\rC2.java"
    compile @list5

} {PASS}
Test Case: non-jls-argument-expansion-6
Empty line in @ file argument

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-6 { Empty line in @ file
        argument } {
    
    saveas list6 "C1.java\n\rC2.java"
    compile @list6

} {PASS}
Test Case: non-jls-argument-expansion-7
Spaces in a @ argument file should not cause the compile to fail

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-7 { Spaces in a @ argument file
        should not cause the compile to fail } {
    
    saveas list7 "C1.java \n C2.java "
    compile @list7

} {PASS}
Test Case: non-jls-argument-expansion-8
Tabs in a @ argument file should not cause the compile to fail

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-8 { Tabs in a @ argument file
        should not cause the compile to fail } {
    
    saveas list8 "\tC1.java\nC2.java\t"
    compile @list8

} {PASS}
Test Case: non-jls-argument-expansion-9
Tabs and spaces in a @ argument file should not cause the compile to fail

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-9 { Tabs and spaces in a @ argument
        file should not cause the compile to fail } {
    
    saveas list9 "\t C1.java \n C2.java \t"
    compile @list9

} {PASS}
Test Case: non-jls-argument-expansion-10
Tabs and spaces in empty line of a @ argument should be ignored

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-10 { Tabs and spaces in empty line
        of a @ argument should be ignored } {
    
    saveas list10 "C1.java\n\t \nC2.java"
    compile @list10

} {PASS}
Test Case: non-jls-argument-expansion-11
Expand empty @ argument. this will terminate without doing anything for JDK 1.3 compatibility

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-11 { Expand empty @ argument.
        this will terminate without doing anything for JDK 1.3
        compatibility } {
    
    saveas list11 ""
    compile @list11

} {PASS}
Test Case: non-jls-argument-expansion-12
Expand empty @ argument

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-12 { Expand empty @ argument
    } {
    
    saveas list12 "\n\n"
    compile @list12

} {PASS}
Test Case: non-jls-argument-expansion-13
Expand empty @ argument

Expected Result: PASS

Regression Test:

tcltest::test non-jls-argument-expansion-13 { Expand empty @ argument
    } {
    
    saveas list13 ""
    compile C1.java @list13

} {PASS}
Test Case: non-jls-argument-expansion-14
Error: Same class compiled twice

Expected Result: FAIL

Regression Test:

tcltest::test non-jls-argument-expansion-14 { Error: Same class compiled
    twice } {
    
    saveas list14 "C1.java"
    compile C1.java @list14

} {FAIL}
Test Case: non-jls-argument-expansion-15
Error: Same class compiled twice

Expected Result: FAIL

Regression Test:

tcltest::test non-jls-argument-expansion-15 { Error: Same class compiled
    twice } {
    
    saveas list15 "C1.java C1.java"
    compile @list15

} {FAIL}

encoding

Directory : tests/non-jls/encoding


Test Case: non-jls-encoding-1
works with the cp437 encoding

Expected Result: PASS

Regression Test:

tcltest::test non-jls-encoding-1 { works with the
        cp437 encoding } {
    
    constant_encoded_expression E1 cp437  \x84 {\u00e4}

} {PASS}
Test Case: non-jls-encoding-2
same character in utf-8

Expected Result: PASS

Regression Test:

tcltest::test non-jls-encoding-2 { same character in
        utf-8 } {
    
    constant_encoded_expression E2 utf-8  \xC3\xA4 {\u00e4}

} {PASS}
Test Case: non-jls-encoding-3
257 is out of the ASCII range, but in 8859-1 it is defined as lower case a with macron from Latin Extended-A

Expected Result: PASS

Regression Test:

tcltest::test non-jls-encoding-3 { 257 is out of the
        ASCII range, but in 8859-1 it is defined as
        lower case a with macron from Latin
        Extended-A  } {
    
    constant_encoded_expression E3 ISO-8859-4  \xE0 {\u0101}

} {PASS}
Test Case: non-jls-encoding-4
same character in utf-8

Expected Result: PASS

Regression Test:

tcltest::test non-jls-encoding-4 { same character in
        utf-8 } {
    
    constant_encoded_expression E4 utf-8  \xC4\x81 {\u0101}

} {PASS}
Test Case: non-jls-encoding-5
65533 (FFFD) is the last symbol in "Specials" category

Expected Result: PASS

Regression Test:

tcltest::test non-jls-encoding-5 { 65533 (FFFD) is the last
          symbol in "Specials" category } {
    
    constant_encoded_expression E5 utf-8  \xEF\xBF\xBD {\uFFFD}

} {PASS}

random-crashers

Directory : tests/non-jls/random-crashers


Test Case: non-jls-random-crashers-1
crash

Expected Result: PASS

Regression Test:

tcltest::test non-jls-random-crashers-1 { crash } {
    
    saveas I.java {
public interface I {
    int hashCode();
}
}

    saveas I2.java {
interface I2 extends I { }
}

    compile I.java I2.java

} {PASS}

gcj tests


gcj

Directory : tests/gcj


Test Case: gcj-PR198
test case for gcj PR198

Expected Result: PASS

Regression Test:

tcltest::test gcj-PR198 { test case for gcj PR198 } {
    
  compile PR198.java

} {PASS}

jikes tests


7.5.2

Directory : tests/jikes/jls/packages/import-declarations/type-import-on-demand-declaration


Test Case: 7.5.2-jikes-package-not-found-1
Check the error message printed by Jikes when a package of a given given name can not be found

Expected Result: FAIL 1

Regression Test:

tcltest::test 7.5.2-jikes-package-not-found-1 { Check the error
        message printed by Jikes when a package of a given
        given name can not be found } {
    

    saveas T752pnf1.java {
import pkg.not.found.*;
class NotFound {}
    }

    list [compile -classpath /notadir T752pnf1.java]  [match_err_or_warn  "*Error: Could not find package \"pkg/not/found\" in:\n*notadir\n*"]

} {FAIL 1}

8.4.5

Directory : tests/jikes/jls/classes/method-declarations/method-body


Test Case: 8.4.5-jikes-1
see if jikes output is mangled by a typo in src/error.cpp

Expected Result: FAIL 1

Regression Test:

tcltest::test 8.4.5-jikes-1 { see if jikes output is mangled
        by a typo in src/error.cpp } {
    
    saveas MangleJikesOutputNoReturn.java {
class MangleJikesOutputNoReturn {
    boolean processCommand(String s) {}
}
    }

    list [compile MangleJikesOutputNoReturn.java]  [match_err_or_warn  "*Error:*contain a return statement with an expression compatible*"]

} {FAIL 1}

8.8.5.1

Directory : tests/jikes/jls/classes/constructor-declarations/constructor-body/explicit-constructor-invocations


Test Case: 8.8.5.1-jikes-before-block-statements-1
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: FAIL 1

Regression Test:

tcltest::test 8.8.5.1-jikes-before-block-statements-1 {
        An ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    list [empty_class T8851jbb1 {
    T8851jbb1() {}
    T8851jbb1(int i) {
        i = 0;
        this();
    }
    }] [match_err_or_warn  "*Error:* first statement in constructor*"]

} {FAIL 1}
Test Case: 8.8.5.1-jikes-before-block-statements-2
An ExplicitConstructorInvocation must appear before the optional BlockStatements

Expected Result: FAIL 1

Regression Test:

tcltest::test 8.8.5.1-jikes-before-block-statements-2 {
        An ExplicitConstructorInvocation must appear
        before the optional BlockStatements } {
    
    list [empty_class T8851jbb2 {
    T8851jbb2() {}
    T8851jbb2(int i) {
        i = 0;
        super();
    }
    }] [match_err_or_warn  "*Error:* first statement in constructor*"]

} {FAIL 1}

jikes

Directory : tests/jikes


Test Case: jikes-1
jikes should fail but not core dump on this dependency

Expected Result: FAIL

Regression Test:

tcltest::test jikes-1 { jikes should fail but not core dump on
        this dependency } {
    
    saveas BrokenDependency.java {
import a_package_that_can_not_be_found.Two;

public class BrokenDependency {
    void foo() {
        Object o = new Two();
    }
}
    }

    # Cleanup the .u file that is produced
    cleanup BrokenDependency.u

    compile -d . +M BrokenDependency.java

} {FAIL}
Test Case: jikes-2
warn on try block that may not be reached

Expected Result: WARN

Regression Test:

tcltest::test jikes-2 { warn on try block that may  not be reached } {
    
    compile [saveas T1.java {
class T1 {
  void foo() {
    try {
      int i = 0;
    } catch (Exception e) {}
  }
}
    }]

} {WARN}

Index of all 1610 tests