strconcat.td 644 B

123456789101112131415161718192021222324
  1. // RUN: llvm-tblgen %s | FileCheck %s
  2. // CHECK: class Y<string Y:S = ?> {
  3. // CHECK: string T = !strconcat(Y:S, "foo");
  4. // CHECK: string T2 = !strconcat(Y:S, !strconcat("foo", !strconcat(Y:S, "bar")));
  5. // CHECK: string S = "foobar";
  6. // CHECK: }
  7. // CHECK: def Z {
  8. // CHECK: string T = "fufoo";
  9. // CHECK: string T2 = "fufoofubar";
  10. // CHECK: string S = "foobar";
  11. // CHECK: }
  12. class Y<string S> {
  13. string T = !strconcat(S, "foo");
  14. // More than two arguments is equivalent to nested calls
  15. string T2 = !strconcat(S, "foo", S, "bar");
  16. // String values concatenate lexically, as in C.
  17. string S = "foo" "bar";
  18. }
  19. def Z : Y<"fu">;