diff llvm/test/TableGen/template-args.td @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents 79ff65ed7e25
children
line wrap: on
line diff
--- a/llvm/test/TableGen/template-args.td	Wed Nov 09 17:47:54 2022 +0900
+++ b/llvm/test/TableGen/template-args.td	Fri Aug 18 09:04:13 2023 +0900
@@ -6,9 +6,12 @@
 // RUN: not llvm-tblgen -DERROR5 %s 2>&1 | FileCheck --check-prefix=ERROR5 %s
 // RUN: not llvm-tblgen -DERROR6 %s 2>&1 | FileCheck --check-prefix=ERROR6 %s
 // RUN: not llvm-tblgen -DERROR7 %s 2>&1 | FileCheck --check-prefix=ERROR7 %s
+// RUN: not llvm-tblgen -DERROR8 %s 2>&1 | FileCheck --check-prefix=ERROR8 %s
+// RUN: not llvm-tblgen -DERROR9 %s 2>&1 | FileCheck --check-prefix=ERROR9 %s
+// RUN: not llvm-tblgen -DERROR10 %s 2>&1 | FileCheck --check-prefix=ERROR10 %s
 
-// This file tests that template arguments are type-checked and cast
-// if necessary.
+// This file tests that all required arguments are specified and template
+// arguments are type-checked and cast if necessary.
 
 // Class template arguments.
 
@@ -25,7 +28,7 @@
 }
 
 #ifdef ERROR1
-// ERROR1: Value specified for template argument 'Class1:nm' (#0) is of type int
+// ERROR1: Value specified for template argument 'Class1:nm' is of type int
 
 def Rec2 : Class1<42> {
 }
@@ -52,7 +55,7 @@
 }
 
 #ifdef ERROR2
-// ERROR2: Value specified for template argument 'Class2:cd' (#0) is of type string
+// ERROR2: Value specified for template argument 'Class2:cd' is of type string
 
 def Rec5 : Class2<"oops"> {
   list<int> CodeList = [Code];
@@ -69,7 +72,7 @@
 }
 
 #ifdef ERROR3
-// ERROR3: Value specified for template argument 'Class1:nm' (#0) is of type int
+// ERROR3: Value specified for template argument 'Class1:nm' is of type int
 
 def Rec7 {
   string Name = Class1<42>.Name;
@@ -84,7 +87,7 @@
 }
 
 #ifdef ERROR4
-// ERROR4: Value specified for template argument 'Class2:cd' (#0) is of type string
+// ERROR4: Value specified for template argument 'Class2:cd' is of type string
 
 def Rec9 {
   list<int> CodeList = [Class2<"huh?">.Code];
@@ -110,7 +113,7 @@
 defm RecMC1 : MC1<"Carol">;
 
 #ifdef ERROR5
-// ERROR5: Value specified for template argument 'MC1::nm' (#0) is of type int
+// ERROR5: Value specified for template argument 'MC1::nm' is of type int
 
 defm RecMC2 : MC1<42>;
 #endif
@@ -137,7 +140,7 @@
 defm RecMC3 : MC2<42>;
 
 #ifdef ERROR6
-// ERROR6: Value specified for template argument 'MC2::cd' (#0) is of type string
+// ERROR6: Value specified for template argument 'MC2::cd' is of type string
 
 defm RecMC4 : MC2<"Bob">;
 #endif
@@ -151,3 +154,23 @@
 defm MissingComma : TwoArgs<2 "two">;
 // ERROR7: [[#@LINE-1]]:31: error: Expected comma before next argument
 #endif
+
+#ifdef ERROR8
+def error8: Class1;
+// ERROR8: value not specified for template argument 'Class1:nm'
+// ERROR8: 18:21: note: declared in 'Class1'
+#endif
+
+#ifdef ERROR9
+defm error9: MC1;
+// ERROR9: value not specified for template argument 'MC1::nm'
+// ERROR9: 99:23: note: declared in 'MC1'
+#endif
+
+#ifdef ERROR10
+def error10 {
+  int value = Class2<>.Code;
+}
+// ERROR10: value not specified for template argument 'Class2:cd'
+// ERROR10: 37:22: note: declared in 'Class2'
+#endif