From c5c8e3205f847f2fa1fb0890ce067afc4a6f419c Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 25 Mar 2015 06:44:09 -0700
Subject: [PATCH 4/7] Add testfile-x32 to run-addrcfi.sh

	* run-addrcfi.sh: Add a test for testfile-x32.
	* testfile-x32.bz2: New file.
---
 tests/run-addrcfi.sh   |  77 ++++++++++++++++++++++++++++++++++++++++++++++++-
 tests/testfile-x32.bz2 | Bin 0 -> 3092 bytes
 2 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100755 tests/testfile-x32.bz2

diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh
index 2559c33..66124b3 100755
--- a/tests/run-addrcfi.sh
+++ b/tests/run-addrcfi.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2013
+# Copyright (C) 2013, 2015
 # This file is part of elfutils.
 #
 # This file is free software; you can redistribute it and/or modify
@@ -3671,3 +3671,78 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
 	FP/SIMD reg94 (v30): undefined
 	FP/SIMD reg95 (v31): undefined
 EOF
+
+# EM_X86_64/ELFCLASS32 (function bar 0x00400390)
+#
+# Note. Only in .eh_frame, there is no .debug_frame.
+# Same as PPC above but with -mx32.
+testfiles testfile-x32
+testrun_compare ${abs_builddir}/addrcfi -e testfile-x32 0x00400390 <<\EOF
+.eh_frame has 0x400390 => [0x400390, 0x40039c):
+	return address in reg16
+	CFA location expression: bregx(7,8)
+	integer reg0 (%rax): same_value
+	integer reg1 (%rdx): undefined
+	integer reg2 (%rcx): undefined
+	integer reg3 (%rbx): undefined
+	integer reg4 (%rsi): undefined
+	integer reg5 (%rdi): undefined
+	integer reg6 (%rbp): same_value
+	integer reg7 (%rsp): location expression: call_frame_cfa stack_value
+	integer reg8 (%r8): undefined
+	integer reg9 (%r9): undefined
+	integer reg10 (%r10): undefined
+	integer reg11 (%r11): undefined
+	integer reg12 (%r12): same_value
+	integer reg13 (%r13): same_value
+	integer reg14 (%r14): same_value
+	integer reg15 (%r15): same_value
+	integer reg16 (%rip): location expression: call_frame_cfa plus_uconst(-8)
+	SSE reg17 (%xmm0): undefined
+	SSE reg18 (%xmm1): undefined
+	SSE reg19 (%xmm2): undefined
+	SSE reg20 (%xmm3): undefined
+	SSE reg21 (%xmm4): undefined
+	SSE reg22 (%xmm5): undefined
+	SSE reg23 (%xmm6): undefined
+	SSE reg24 (%xmm7): undefined
+	SSE reg25 (%xmm8): undefined
+	SSE reg26 (%xmm9): undefined
+	SSE reg27 (%xmm10): undefined
+	SSE reg28 (%xmm11): undefined
+	SSE reg29 (%xmm12): undefined
+	SSE reg30 (%xmm13): undefined
+	SSE reg31 (%xmm14): undefined
+	SSE reg32 (%xmm15): undefined
+	x87 reg33 (%st0): undefined
+	x87 reg34 (%st1): undefined
+	x87 reg35 (%st2): undefined
+	x87 reg36 (%st3): undefined
+	x87 reg37 (%st4): undefined
+	x87 reg38 (%st5): undefined
+	x87 reg39 (%st6): undefined
+	x87 reg40 (%st7): undefined
+	MMX reg41 (%mm0): undefined
+	MMX reg42 (%mm1): undefined
+	MMX reg43 (%mm2): undefined
+	MMX reg44 (%mm3): undefined
+	MMX reg45 (%mm4): undefined
+	MMX reg46 (%mm5): undefined
+	MMX reg47 (%mm6): undefined
+	MMX reg48 (%mm7): undefined
+	integer reg49 (%rflags): undefined
+	segment reg50 (%es): undefined
+	segment reg51 (%cs): undefined
+	segment reg52 (%ss): undefined
+	segment reg53 (%ds): undefined
+	segment reg54 (%fs): undefined
+	segment reg55 (%gs): undefined
+	segment reg58 (%fs.base): undefined
+	segment reg59 (%gs.base): undefined
+	control reg62 (%tr): undefined
+	control reg63 (%ldtr): undefined
+	control reg64 (%mxcsr): undefined
+	control reg65 (%fcw): undefined
+	control reg66 (%fsw): undefined
+handle_cfi no CFI (.debug_frame): no error
+EOF
diff --git a/tests/testfile-x32.bz2 b/tests/testfile-x32.bz2
new file mode 100755
index 0000000000000000000000000000000000000000..5f3149b90bba7b49da6b0355ef4edaa5b66d48b8
GIT binary patch
-- 
2.1.0

