brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 2791474 Raw
40 lines · plain
1// RUN: %clang_cc1 -std=c2y -fsyntax-only -verify -fblocks %s2 3void f1(id y) {4    l1: for (id x in y) {5        break l1;6        continue l1;7    }8 9    l2: for (id x in y) {10        break l1; // expected-error {{'break' label does not name an enclosing loop or 'switch'}}11        continue l1; // expected-error {{'continue' label does not name an enclosing loop}}12    }13 14    l3: for (id x in y) {15        l4: for (id x in y) {16            break l3;17            break l4;18            continue l3;19            continue l4;20        }21    }22}23 24void f2(id y) {25    l1: for (id x in ({26        break l1; // expected-error {{'break' label does not name an enclosing loop or 'switch'}}27        continue l1; // expected-error {{'continue' label does not name an enclosing loop}}28        y;29    })) {}30}31 32void f3(id y) {33  a: b: for (id x in y) {34    (void) ^{35      break a; // expected-error {{'break' label does not name an enclosing loop or 'switch'}}36      continue b; // expected-error {{'continue' label does not name an enclosing loop}}37    };38  }39}40