From e096fa7aa6161e1f5a74001185eb3873a684c48d Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Tue, 27 Jan 2015 16:57:20 +0100 Subject: ABI compatibility for struct/union function arguments passed by value. The passing of struct/union arguments by value implemented in the verified part of CompCert is not compatible with the ARM, PowerPC and x86 ABI. Here we enrich the StructReturn source-to-source emulation pass so that it implements the calling conventions defined in these ABIs. Plus: for x86, implement the returning of struct/union results by value in a way compatible with the ABI. --- test/regression/Results/interop1 | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 test/regression/Results/interop1 (limited to 'test/regression/Results') diff --git a/test/regression/Results/interop1 b/test/regression/Results/interop1 new file mode 100644 index 00000000..34ec8e6b --- /dev/null +++ b/test/regression/Results/interop1 @@ -0,0 +1,62 @@ +--- CompCert calling native: +s1 = { a = 'a' } +s2 = { a = 'x', b = 'y' } +s3 = { a = 'a', b = 'b', c = ' c' } +s4 = { a = 'p', b = 'q', c = ' r', d = 's' } +s5 = { a = 'a', b = 'b', c = ' c', d = 'd', e = 'e' } +s6 = { a = 'a', b = 'b', c = ' c', d = 'd', e = 'e', f = 'f' } +s7 = { a = 'a', b = 'b', c = ' c', d = 'd', e = 'e', f = 'f', g = 'g' } +s8 = "Hello, world!" +t1 = { a = 12 } +t2 = { a = 34, b = 56 } +t3 = { a = -1, b = -2, c = -3 } +t4 = { a = 11, b = 22, c = 33, d = 44 } +t4 = { a = 1, b = 2, c = 3, d = 4, e = 'x' } +u1 = { a = 12345678 } +u2 = { a = 1, b = -1 } +u3 = { a = -1, b = -2, c = -3 } +u4 = { a = 4, b = 3, c = 2, d = 1 } +u5 = { a = 123, b = 'z' } +u6 = { a = -12345678, b = 555 } +u7 = { a = 111111111, b = 2222, c = 'a' } +u8 = { a = 'u', b = 8 } +u9 = { a = 3.14159, b = -2.718 } +rs1 = { a = 'a' } +rs2 = { a = 'a', b = 'b' } +rs3 = { a = 'a', b = 'b', c = 'c' } +rs4 = { a = 'a', b = 'b', c = 'c', d = 'd' } +rs8 = { "Lorem ipsum" } +ru2 = { a = 12, b = -34 } +ru6 = { a = 12345678, b = -9999 } +ru9 = { a = 0.123400, b = -5678.900000 } +--- native calling CompCert: +s1 = { a = 'a' } +s2 = { a = 'x', b = 'y' } +s3 = { a = 'a', b = 'b', c = ' c' } +s4 = { a = 'p', b = 'q', c = ' r', d = 's' } +s5 = { a = 'a', b = 'b', c = ' c', d = 'd', e = 'e' } +s6 = { a = 'a', b = 'b', c = ' c', d = 'd', e = 'e', f = 'f' } +s7 = { a = 'a', b = 'b', c = ' c', d = 'd', e = 'e', f = 'f', g = 'g' } +s8 = "Hello, world!" +t1 = { a = 12 } +t2 = { a = 34, b = 56 } +t3 = { a = -1, b = -2, c = -3 } +t4 = { a = 11, b = 22, c = 33, d = 44 } +t4 = { a = 1, b = 2, c = 3, d = 4, e = 'x' } +u1 = { a = 12345678 } +u2 = { a = 1, b = -1 } +u3 = { a = -1, b = -2, c = -3 } +u4 = { a = 4, b = 3, c = 2, d = 1 } +u5 = { a = 123, b = 'z' } +u6 = { a = -12345678, b = 555 } +u7 = { a = 111111111, b = 2222, c = 'a' } +u8 = { a = 'u', b = 8 } +u9 = { a = 3.14159, b = -2.718 } +rs1 = { a = 'a' } +rs2 = { a = 'a', b = 'b' } +rs3 = { a = 'a', b = 'b', c = 'c' } +rs4 = { a = 'a', b = 'b', c = 'c', d = 'd' } +rs8 = { "Lorem ipsum" } +ru2 = { a = 12, b = -34 } +ru6 = { a = 12345678, b = -9999 } +ru9 = { a = 0.123400, b = -5678.900000 } -- cgit