| // RUN: llvm-tblgen %s | FileCheck %s |
| // RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s |
| // RUN: not llvm-tblgen -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s |
| // Test inside a foreach, with condition based on the iteration variable. |
| // Test inside a multiclass, with condition based on a multiclass parameter. |
| multiclass Multi<int i> { |
| // CHECK-NOT: def c1ThenRec |
| // CHECK: def c1Unconditional |
| // CHECK-NOT: def c2ThenRec |
| // CHECK: def c2Unconditional |
| // CHECK-NOT: def c3ElseRec |
| // CHECK: def c3Unconditional |
| // Test resolution of the dangling-else ambiguity. |
| // CHECK: def dThenElse00 |
| // CHECK-NOT: def dThenElse1 |
| // CHECK-NOT: def dThenElse11 |
| // CHECK: def dThenThen01 |
| else // binds to the inner if, not the outer one |
| // Error tests: ensure you can't put an if inside a def or class. |
| // ERROR1: [[@LINE+1]]:3: error: Unknown token when expecting a type |
| // ERROR2: [[@LINE+1]]:3: error: Unknown token when expecting a type |