GIT 1.1.6
[git/mingw/4msysgit/kblees.git] / t / t4112-apply-renames.sh
bloba06f6956d5c72cae79129fc01a1be2f30121e6fb
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git-apply should not get confused with rename/copy.
10 . ./test-lib.sh
12 # setup
14 mkdir -p include/arch/x86_64/klibc klibc/arch/x86_64/include/klibc
16 cat >include/arch/x86_64/klibc/archsetjmp.h <<\EOF
18 * arch/x86_64/include/klibc/archsetjmp.h
21 #ifndef _KLIBC_ARCHSETJMP_H
22 #define _KLIBC_ARCHSETJMP_H
24 struct __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;
35 typedef struct __jmp_buf jmp_buf[1];
37 #endif /* _SETJMP_H */
38 EOF
40 cat >klibc/arch/x86_64/include/klibc/archsetjmp.h <<\EOF
42 * arch/x86_64/include/klibc/archsetjmp.h
45 #ifndef _KLIBC_ARCHSETJMP_H
46 #define _KLIBC_ARCHSETJMP_H
48 struct __jmp_buf {
49 unsigned long __rbx;
50 unsigned long __rsp;
51 unsigned long __rbp;
52 unsigned long __r12;
53 unsigned long __r13;
54 unsigned long __r14;
55 unsigned long __r15;
56 unsigned long __rip;
59 typedef struct __jmp_buf jmp_buf[1];
61 #endif /* _SETJMP_H */
62 EOF
64 cat >patch <<\EOF
65 diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/cris/klibc/archsetjmp.h
66 similarity index 76%
67 copy from klibc/arch/x86_64/include/klibc/archsetjmp.h
68 copy to include/arch/cris/klibc/archsetjmp.h
69 --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
70 +++ b/include/arch/cris/klibc/archsetjmp.h
71 @@ -1,21 +1,24 @@
73 - * arch/x86_64/include/klibc/archsetjmp.h
74 + * arch/cris/include/klibc/archsetjmp.h
77 #ifndef _KLIBC_ARCHSETJMP_H
78 #define _KLIBC_ARCHSETJMP_H
80 struct __jmp_buf {
81 - unsigned long __rbx;
82 - unsigned long __rsp;
83 - unsigned long __rbp;
84 - unsigned long __r12;
85 - unsigned long __r13;
86 - unsigned long __r14;
87 - unsigned long __r15;
88 - unsigned long __rip;
89 + unsigned long __r0;
90 + unsigned long __r1;
91 + unsigned long __r2;
92 + unsigned long __r3;
93 + unsigned long __r4;
94 + unsigned long __r5;
95 + unsigned long __r6;
96 + unsigned long __r7;
97 + unsigned long __r8;
98 + unsigned long __sp;
99 + unsigned long __srp;
102 typedef struct __jmp_buf jmp_buf[1];
104 -#endif /* _SETJMP_H */
105 +#endif /* _KLIBC_ARCHSETJMP_H */
106 diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/m32r/klibc/archsetjmp.h
107 similarity index 66%
108 rename from klibc/arch/x86_64/include/klibc/archsetjmp.h
109 rename to include/arch/m32r/klibc/archsetjmp.h
110 --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
111 +++ b/include/arch/m32r/klibc/archsetjmp.h
112 @@ -1,21 +1,21 @@
114 - * arch/x86_64/include/klibc/archsetjmp.h
115 + * arch/m32r/include/klibc/archsetjmp.h
118 #ifndef _KLIBC_ARCHSETJMP_H
119 #define _KLIBC_ARCHSETJMP_H
121 struct __jmp_buf {
122 - unsigned long __rbx;
123 - unsigned long __rsp;
124 - unsigned long __rbp;
125 + unsigned long __r8;
126 + unsigned long __r9;
127 + unsigned long __r10;
128 + unsigned long __r11;
129 unsigned long __r12;
130 unsigned long __r13;
131 unsigned long __r14;
132 unsigned long __r15;
133 - unsigned long __rip;
136 typedef struct __jmp_buf jmp_buf[1];
138 -#endif /* _SETJMP_H */
139 +#endif /* _KLIBC_ARCHSETJMP_H */
142 find include klibc -type f -print | xargs git-update-index --add --
144 test_expect_success 'check rename/copy patch' 'git-apply --check patch'
146 test_expect_success 'apply rename/copy patch' 'git-apply --index patch'
148 test_done