37 lines · plain
1// RUN: llvm-tblgen %s | FileCheck %s2// RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s3// RUN: not llvm-tblgen -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s4// RUN: not llvm-tblgen -DERROR3 %s 2>&1 | FileCheck --check-prefix=ERROR3 %s5// RUN: not llvm-tblgen -DERROR4 %s 2>&1 | FileCheck --check-prefix=ERROR4 %s6// XFAIL: vg_leak7 8def test {9 bit test0 = !match("123 abc ABC", "[0-9 a-z A-Z]+");10 bit test1 = !match("abc", "[0-9]+");11}12 13// CHECK-LABEL: def test {14// CHECK-NEXT: bit test0 = 1;15// CHECK-NEXT: bit test1 = 0;16// CHECK-NEXT: }17 18#ifdef ERROR119defvar error1 = !match(123, ".*");20// ERROR1: error: expected value of type 'string', got 'int'21#endif22 23#ifdef ERROR224defvar error2 = !match("abc", 123);25// ERROR2: error: expected value of type 'string', got 'int'26#endif27 28#ifdef ERROR329defvar error3 = !match("abc", "abc", "abc");30// ERROR3: error: expected two operands to operator31#endif32 33#ifdef ERROR434defvar error4 = !match("abc", "([)]");35// ERROR4: error: invalid regex '([)]'36#endif37