Changeset 9d6317f for tests


Ignore:
Timestamp:
Jan 22, 2020, 3:40:27 PM (4 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
69e398f
Parents:
5518719
Message:

Added checks for returning from a finally clause. And breaking from a nested function.

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/except-finally-error.txt

    r5518719 r9d6317f  
    1111except-finally-error.cfa:111:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose'
    1212except-finally-error.cfa:124:1 error: 'fallthrough' must be enclosed in a 'switch' or 'choose'
     13except-finally-error.cfa:133:1 error: 'return' may not appear in a finally clause
     14except-finally-error.cfa:139:1 error: 'return' may not appear in a finally clause
     15except-finally-error.cfa:148:1 error: 'break' outside a loop, 'switch', or labelled block
  • tests/except-finally-error.cfa

    r5518719 r9d6317f  
    142142}
    143143
     144// Checked in the same place, make sure it does't break.
     145void break_in_function() {
     146        while (true) {
     147                void inner() {
     148                        break;
     149                }
     150        }
     151}
     152
    144153void main() {
    145154        // Should not compile.
Note: See TracChangeset for help on using the changeset viewer.