1 // RUN: llvm-tblgen %s | FileCheck %s
2 // RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
4 // This file tests the !cast bang operator with the result type string.
6 defvar IntList = [0, 1, 2, 3, 4, 5, 6];
9 // CHECK: string str3 = "a string here"
12 string str = "a string";
13 string str2 = !cast<string>(str);
14 string str3 = !cast<string>(str # " here");
18 // CHECK: string str = "42 -108"
23 string str = !cast<string>(int1) # " " # !cast<string>(int2);
27 // CHECK: string str = "0, 1"
32 string str = !cast<string>(bit1) # ", " # !cast<string>(bit2);
36 // CHECK: string str = "5 and 37"
39 bits<4> bits1 = 0b0101;
40 bits<8> bits2 = 0b00100101;
41 string str = !cast<string>(bits1) # " and " # !cast<string>(bits2);
45 // CHECK: string str = "Rec1, Rec2"
48 string str = !cast<string>(Rec1) # ", " # !cast<string>(Rec2);
53 // ERROR1: nitializer of 'str' in 'Rec5' could not be fully resolved
56 string str = !cast<string>(IntList);