summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/Mips/long-call-mcount.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/long-call-mcount.ll b/llvm/test/CodeGen/Mips/long-call-mcount.ll
new file mode 100644
index 00000000000..70a4410d060
--- /dev/null
+++ b/llvm/test/CodeGen/Mips/long-call-mcount.ll
@@ -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" }
OpenPOWER on IntegriCloud