[PATCH] D70017: [mips][test] Add Mips CPU tests

Miloš Stojanović via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 07:22:45 PST 2019


mstojanovic updated this revision to Diff 228890.
mstojanovic added a comment.

Merged and expanded the test.

Do you think the tests from D70018 <https://reviews.llvm.org/D70018> should also be in the same file or is it fine how it is?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70017/new/

https://reviews.llvm.org/D70017

Files:
  llvm/test/CodeGen/Mips/cpus.ll


Index: llvm/test/CodeGen/Mips/cpus.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/Mips/cpus.ll
@@ -0,0 +1,47 @@
+; Test that the CPU names work.
+
+; RUN: llc -mtriple=mips -mcpu=mips2 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS2
+; MIPS2: ISA: MIPS2
+; RUN: llc -mtriple=mips64 -mcpu=mips3 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS3
+; MIPS3: ISA: MIPS3
+; RUN: llc -mtriple=mips64 -mcpu=mips4 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS4
+; MIPS4: ISA: MIPS4
+
+; RUN: llc -mtriple=mips -mcpu=mips32 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS32
+; MIPS32: ISA: MIPS32
+; RUN: llc -mtriple=mips -mcpu=mips32r2 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS32R2
+; MIPS32R2: ISA: MIPS32r2
+; RUN: llc -mtriple=mips -mcpu=mips32r3 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS32R3
+; MIPS32R3: ISA: MIPS32r3
+; RUN: llc -mtriple=mips -mcpu=mips32r5 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS32R5
+; MIPS32R5: ISA: MIPS32r5
+; RUN: llc -mtriple=mips -mcpu=mips32r6 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS32R6
+; MIPS32R6: ISA: MIPS32r6
+
+; RUN: llc -mtriple=mips64 -mcpu=mips64 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS64
+; MIPS64: ISA: MIPS64
+; RUN: llc -mtriple=mips64 -mcpu=mips64r2 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS64R2
+; MIPS64R2: ISA: MIPS64r2
+; RUN: llc -mtriple=mips64 -mcpu=mips64r3 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS64R3
+; MIPS64R3: ISA: MIPS64r3
+; RUN: llc -mtriple=mips64 -mcpu=mips64r5 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS64R5
+; MIPS64R5: ISA: MIPS64r5
+; RUN: llc -mtriple=mips64 -mcpu=mips64r6 -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=MIPS64R6
+; MIPS64R6: ISA: MIPS64r6
+
+; RUN: llc -mtriple=mips64 -mcpu=octeon -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=OCTEON
+; OCTEON: ISA: MIPS64r2
+; OCTEON: ISA Extension: Cavium Networks Octeon
+; RUN: llc -mtriple=mips64 -mcpu=octeon+ -filetype=obj < %s | llvm-readelf -A | FileCheck %s --check-prefix=OCTEONP
+; OCTEONP: ISA: MIPS64r2
+; OCTEONP: ISA Extension: Cavium Networks OcteonP
+
+; Check that we reject CPUs that are not implemented.
+; CHECK-ERROR-NOT-IMPLEMENTED: LLVM ERROR: Code generation for MIPS-{{.}} is not implemented
+
+; RUN: not llc < %s -o /dev/null -mtriple=mips -mcpu=mips1 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR-NOT-IMPLEMENTED
+; RUN: not llc < %s -o /dev/null -mtriple=mips64 -mcpu=mips5 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR-NOT-IMPLEMENTED
+
+define void @foo() {
+  ret void
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70017.228890.patch
Type: text/x-patch
Size: 2870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191112/8df0e4fe/attachment.bin>


More information about the llvm-commits mailing list