summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Mips
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2017-12-22 13:45:46 +0000
committerSimon Atanasyan <simon@atanasyan.com>2017-12-22 13:45:46 +0000
commit5cd90ccbe344c73f0222f1607609271d3e80442f (patch)
tree196d70bcea9c7b96398b958786214356dbc3bf26 /llvm/test/CodeGen/Mips
parent28a6d0e6396b093c9d63ff3c7bf2a90abe29614f (diff)
downloadbcm5719-llvm-5cd90ccbe344c73f0222f1607609271d3e80442f.tar.gz
bcm5719-llvm-5cd90ccbe344c73f0222f1607609271d3e80442f.zip
[mips] Add test case to check that calls to mcount follow long calls / short calls options. NFC
llvm-svn: 321357
Diffstat (limited to 'llvm/test/CodeGen/Mips')
-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