1#!/bin/sh
2#
3# Copyright (c) 2005 Junio C Hamano
4#
5
6test_description='git-apply should not get confused with rename/copy.
7
8'
9
10. ./test-lib.sh
11
12# setup
13
14mkdir -p klibc/arch/x86_64/include/klibc
15
16cat >klibc/arch/x86_64/include/klibc/archsetjmp.h <<\EOF
17/*
18 * arch/x86_64/include/klibc/archsetjmp.h
19 */
20
21#ifndef _KLIBC_ARCHSETJMP_H
22#define _KLIBC_ARCHSETJMP_H
23
24struct __jmp_buf {
25 unsigned long __rbx;
26 unsigned long __rsp;
27 unsigned long __rbp;
28 unsigned long __r12;
29 unsigned long __r13;
30 unsigned long __r14;
31 unsigned long __r15;
32 unsigned long __rip;
33};
34
35typedef struct __jmp_buf jmp_buf[1];
36
37#endif /* _SETJMP_H */
38EOF
39
40cat >patch <<\EOF
41diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/cris/klibc/archsetjmp.h
42similarity index 76%
43copy from klibc/arch/x86_64/include/klibc/archsetjmp.h
44copy to include/arch/cris/klibc/archsetjmp.h
45--- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
46+++ b/include/arch/cris/klibc/archsetjmp.h
47@@ -1,21 +1,24 @@
48 /*
49- * arch/x86_64/include/klibc/archsetjmp.h
50+ * arch/cris/include/klibc/archsetjmp.h
51 */
52
53 #ifndef _KLIBC_ARCHSETJMP_H
54 #define _KLIBC_ARCHSETJMP_H
55
56 struct __jmp_buf {
57- unsigned long __rbx;
58- unsigned long __rsp;
59- unsigned long __rbp;
60- unsigned long __r12;
61- unsigned long __r13;
62- unsigned long __r14;
63- unsigned long __r15;
64- unsigned long __rip;
65+ unsigned long __r0;
66+ unsigned long __r1;
67+ unsigned long __r2;
68+ unsigned long __r3;
69+ unsigned long __r4;
70+ unsigned long __r5;
71+ unsigned long __r6;
72+ unsigned long __r7;
73+ unsigned long __r8;
74+ unsigned long __sp;
75+ unsigned long __srp;
76 };
77
78 typedef struct __jmp_buf jmp_buf[1];
79
80-#endif /* _SETJMP_H */
81+#endif /* _KLIBC_ARCHSETJMP_H */
82diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/m32r/klibc/archsetjmp.h
83similarity index 66%
84rename from klibc/arch/x86_64/include/klibc/archsetjmp.h
85rename to include/arch/m32r/klibc/archsetjmp.h
86--- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
87+++ b/include/arch/m32r/klibc/archsetjmp.h
88@@ -1,21 +1,21 @@
89 /*
90- * arch/x86_64/include/klibc/archsetjmp.h
91+ * arch/m32r/include/klibc/archsetjmp.h
92 */
93
94 #ifndef _KLIBC_ARCHSETJMP_H
95 #define _KLIBC_ARCHSETJMP_H
96
97 struct __jmp_buf {
98- unsigned long __rbx;
99- unsigned long __rsp;
100- unsigned long __rbp;
101+ unsigned long __r8;
102+ unsigned long __r9;
103+ unsigned long __r10;
104+ unsigned long __r11;
105 unsigned long __r12;
106 unsigned long __r13;
107 unsigned long __r14;
108 unsigned long __r15;
109- unsigned long __rip;
110 };
111
112 typedef struct __jmp_buf jmp_buf[1];
113
114-#endif /* _SETJMP_H */
115+#endif /* _KLIBC_ARCHSETJMP_H */
116EOF
117
118find klibc -type f -print | xargs git-update-index --add --
119
120test_expect_success 'check rename/copy patch' 'git-apply --check patch'
121
122test_expect_success 'apply rename/copy patch' 'git-apply --index patch'
123
124test_done