summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/PowerPC/ppc64-initial-cfa.ll
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2012-11-28 18:21:03 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2012-11-28 18:21:03 +0000
commit9e159fd7a02e3744f17c792a49dc440c4159be0f (patch)
tree533cb39837e907139d7b618161bbac693a0b5063 /llvm/test/MC/PowerPC/ppc64-initial-cfa.ll
parent53f7e129091643944d484017105fa906613e42c0 (diff)
downloadbcm5719-llvm-9e159fd7a02e3744f17c792a49dc440c4159be0f.tar.gz
bcm5719-llvm-9e159fd7a02e3744f17c792a49dc440c4159be0f.zip
Fix initial frame state on powerpc64.
The createPPCMCAsmInfo routine used PPC::R1 as the initial frame pointer register, but on PPC64 the 32-bit R1 register does not have a corresponding DWARF number, causing invalid CIE initial frame state to be emitted. Fix by using PPC::X1 instead. llvm-svn: 168799
Diffstat (limited to 'llvm/test/MC/PowerPC/ppc64-initial-cfa.ll')
-rw-r--r--llvm/test/MC/PowerPC/ppc64-initial-cfa.ll41
1 files changed, 41 insertions, 0 deletions
diff --git a/llvm/test/MC/PowerPC/ppc64-initial-cfa.ll b/llvm/test/MC/PowerPC/ppc64-initial-cfa.ll
new file mode 100644
index 00000000000..3936cf2e81e
--- /dev/null
+++ b/llvm/test/MC/PowerPC/ppc64-initial-cfa.ll
@@ -0,0 +1,41 @@
+;; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -filetype=obj %s -o - | \
+;; RUN: elf-dump --dump-section-data | FileCheck %s
+
+;; FIXME: this file should be in .s form, change when asm parser is available.
+
+define void @f() {
+entry:
+ ret void
+}
+
+;; CHECK: ('sh_name', 0x{{.*}}) # '.eh_frame'
+;; CHECK-NEXT: ('sh_type', 0x00000001)
+;; CHECK-NEXT: ('sh_flags', 0x0000000000000002)
+;; CHECK-NEXT: ('sh_addr', 0x{{.*}})
+;; CHECK-NEXT: ('sh_offset', 0x{{.*}})
+;; CHECK-NEXT: ('sh_size', 0x0000000000000030)
+;; CHECK-NEXT: ('sh_link', 0x00000000)
+;; CHECK-NEXT: ('sh_info', 0x00000000)
+;; CHECK-NEXT: ('sh_addralign', 0x0000000000000008)
+;; CHECK-NEXT: ('sh_entsize', 0x0000000000000000)
+;; CHECK-NEXT: ('_section_data', '00000010 00000000 017a5200 01784101 000c0100 00000018 00000018 00000000 00000000 00000000 00000010 00000000')
+
+;; CHECK: ('sh_name', 0x{{.*}}) # '.rela.eh_frame'
+;; CHECK-NEXT: ('sh_type', 0x00000004)
+;; CHECK-NEXT: ('sh_flags', 0x0000000000000000)
+;; CHECK-NEXT: ('sh_addr', 0x{{.*}})
+;; CHECK-NEXT: ('sh_offset', 0x{{.*}})
+;; CHECK-NEXT: ('sh_size', 0x0000000000000018)
+;; CHECK-NEXT: ('sh_link', 0x{{.*}})
+;; CHECK-NEXT: ('sh_info', 0x{{.*}})
+;; CHECK-NEXT: ('sh_addralign', 0x0000000000000008)
+;; CHECK-NEXT: ('sh_entsize', 0x0000000000000018)
+;; CHECK-NEXT: ('_relocations', [
+;; CHECK-NEXT: # Relocation 0
+;; CHECK-NEXT: (('r_offset', 0x000000000000001c)
+;; CHECK-NEXT: ('r_sym', 0x{{.*}})
+;; CHECK-NEXT: ('r_type', 0x00000026)
+;; CHECK-NEXT: ('r_addend', 0x0000000000000000)
+;; CHECK-NEXT: ),
+;; CHECK-NEXT: ])
+
OpenPOWER on IntegriCloud