[PATCH] D40362: [TableGen][AsmMatcherEmitter] Only choose specific diagnostic for enabled instruction

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 04:47:32 PST 2017


sdardis added inline comments.


================
Comment at: test/MC/Mips/micromips32r6/invalid-wrong-error.s:10-29
+  teq $8, $9, $2           # CHECK: :[[@LINE]]:15: error: expected 4-bit unsigned immediate
+  teq $8, $9, -1           # CHECK: :[[@LINE]]:15: error: expected 4-bit unsigned immediate
   teq $8, $9, 16           # CHECK: :[[@LINE]]:3: error: instruction requires a CPU feature not currently enabled
-  tge $8, $9, $2           # CHECK: :[[@LINE]]:15: error: expected 10-bit unsigned immediate
-  tge $8, $9, -1           # CHECK: :[[@LINE]]:15: error: expected 10-bit unsigned immediate
+  tge $8, $9, $2           # CHECK: :[[@LINE]]:15: error: expected 4-bit unsigned immediate
+  tge $8, $9, -1           # CHECK: :[[@LINE]]:15: error: expected 4-bit unsigned immediate
   tge $8, $9, 16           # CHECK: :[[@LINE]]:3: error: instruction requires a CPU feature not currently enabled
+  tgeu $8, $9, $2          # CHECK: :[[@LINE]]:16: error: expected 4-bit unsigned immediate
----------------
sdesmalen wrote:
> sdardis wrote:
> > sdardis wrote:
> > > These all look like improvements.
> > If a line changed here you can move it from this test file to invalid.s in the same directory.
> I'm not sure I understand what you mean here.. ?
The lines that changed here are now giving the correct error, so they're now in the wrong test file, as this file records instructions give a wrong error.

Copy these lines into test/MC/Mips/micromips32r6/invalid.s which tests that we give the correct error, and remove them from this file.


https://reviews.llvm.org/D40362





More information about the llvm-commits mailing list