]> granicus.if.org Git - llvm/commitdiff
[mips] Add test case to check that calls to mcount follow long calls / short calls...
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 22 Dec 2017 13:45:46 +0000 (13:45 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 22 Dec 2017 13:45:46 +0000 (13:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321357 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/Mips/long-call-mcount.ll [new file with mode: 0644]

diff --git a/test/CodeGen/Mips/long-call-mcount.ll b/test/CodeGen/Mips/long-call-mcount.ll
new file mode 100644 (file)
index 0000000..70a4410
--- /dev/null
@@ -0,0 +1,19 @@
+; Check call to mcount in case of long/short call options.
+; RUN: llc -march=mips -target-abi o32 --mattr=+long-calls,+noabicalls < %s \
+; RUN:   | FileCheck -check-prefixes=CHECK,LONG %s
+; RUN: llc -march=mips -target-abi o32 --mattr=-long-calls,+noabicalls < %s \
+; RUN:   | FileCheck -check-prefixes=CHECK,SHORT %s
+
+; Function Attrs: noinline nounwind optnone
+define void @foo() #0 {
+entry:
+  ret void
+
+; CHECK-LABEL: foo
+; LONG:          lui     $1, %hi(_mcount)
+; LONG-NEXT:     addiu   $25, $1, %lo(_mcount)
+; LONG-NEXT:     jalr    $25
+; SHORT:         jal     _mcount
+}
+
+attributes #0 = { "instrument-function-entry-inlined"="_mcount" }