Merge branch 'ao/send-email-irt'
[git/kirr.git] / t / t4112-apply-renames.sh
blobf9ad183758c28ff648890d1bd4bbd599562cd795
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 klibc/arch/x86_64/include/klibc
16 cat >klibc/arch/x86_64/include/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
39 cat >klibc/README <<\EOF
40 This is a simple readme file.
41 EOF
43 cat >patch <<\EOF
44 diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/cris/klibc/archsetjmp.h
45 similarity index 76%
46 copy from klibc/arch/x86_64/include/klibc/archsetjmp.h
47 copy to include/arch/cris/klibc/archsetjmp.h
48 --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
49 +++ b/include/arch/cris/klibc/archsetjmp.h
50 @@ -1,21 +1,24 @@
52 - * arch/x86_64/include/klibc/archsetjmp.h
53 + * arch/cris/include/klibc/archsetjmp.h
56 #ifndef _KLIBC_ARCHSETJMP_H
57 #define _KLIBC_ARCHSETJMP_H
59 struct __jmp_buf {
60 - unsigned long __rbx;
61 - unsigned long __rsp;
62 - unsigned long __rbp;
63 - unsigned long __r12;
64 - unsigned long __r13;
65 - unsigned long __r14;
66 - unsigned long __r15;
67 - unsigned long __rip;
68 + unsigned long __r0;
69 + unsigned long __r1;
70 + unsigned long __r2;
71 + unsigned long __r3;
72 + unsigned long __r4;
73 + unsigned long __r5;
74 + unsigned long __r6;
75 + unsigned long __r7;
76 + unsigned long __r8;
77 + unsigned long __sp;
78 + unsigned long __srp;
81 typedef struct __jmp_buf jmp_buf[1];
83 -#endif /* _SETJMP_H */
84 +#endif /* _KLIBC_ARCHSETJMP_H */
85 diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/m32r/klibc/archsetjmp.h
86 similarity index 66%
87 rename from klibc/arch/x86_64/include/klibc/archsetjmp.h
88 rename to include/arch/m32r/klibc/archsetjmp.h
89 --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
90 +++ b/include/arch/m32r/klibc/archsetjmp.h
91 @@ -1,21 +1,21 @@
93 - * arch/x86_64/include/klibc/archsetjmp.h
94 + * arch/m32r/include/klibc/archsetjmp.h
97 #ifndef _KLIBC_ARCHSETJMP_H
98 #define _KLIBC_ARCHSETJMP_H
100 struct __jmp_buf {
101 - unsigned long __rbx;
102 - unsigned long __rsp;
103 - unsigned long __rbp;
104 + unsigned long __r8;
105 + unsigned long __r9;
106 + unsigned long __r10;
107 + unsigned long __r11;
108 unsigned long __r12;
109 unsigned long __r13;
110 unsigned long __r14;
111 unsigned long __r15;
112 - unsigned long __rip;
115 typedef struct __jmp_buf jmp_buf[1];
117 -#endif /* _SETJMP_H */
118 +#endif /* _KLIBC_ARCHSETJMP_H */
119 diff --git a/klibc/README b/klibc/README
120 --- a/klibc/README
121 +++ b/klibc/README
122 @@ -1,1 +1,4 @@
123 This is a simple readme file.
124 +And we add a few
125 +lines at the
126 +end of it.
127 diff --git a/klibc/README b/klibc/arch/README
128 copy from klibc/README
129 copy to klibc/arch/README
130 --- a/klibc/README
131 +++ b/klibc/arch/README
132 @@ -1,1 +1,3 @@
133 This is a simple readme file.
134 +And we copy it to one level down, and
135 +add a few lines at the end of it.
138 find klibc -type f -print | xargs git update-index --add --
140 test_expect_success 'check rename/copy patch' 'git apply --check patch'
142 test_expect_success 'apply rename/copy patch' 'git apply --index patch'
144 test_done