Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2005 Junio C Hamano |
| 4 | # |
| 5 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 6 | test_description='git apply should not get confused with rename/copy. |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 7 | |
| 8 | ' |
| 9 | |
| 10 | . ./test-lib.sh |
| 11 | |
| 12 | # setup |
| 13 | |
Junio C Hamano | b7a036b | 2006-07-26 11:01:07 -0700 | [diff] [blame] | 14 | mkdir -p klibc/arch/x86_64/include/klibc |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 15 | |
| 16 | cat >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 | |
| 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; |
| 33 | }; |
| 34 | |
| 35 | typedef struct __jmp_buf jmp_buf[1]; |
| 36 | |
| 37 | #endif /* _SETJMP_H */ |
| 38 | EOF |
Junio C Hamano | a9a3e82 | 2008-07-09 19:58:23 -0700 | [diff] [blame] | 39 | cat >klibc/README <<\EOF |
| 40 | This is a simple readme file. |
| 41 | EOF |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 42 | |
| 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 @@ |
| 51 | /* |
| 52 | - * arch/x86_64/include/klibc/archsetjmp.h |
| 53 | + * arch/cris/include/klibc/archsetjmp.h |
| 54 | */ |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 55 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 56 | #ifndef _KLIBC_ARCHSETJMP_H |
| 57 | #define _KLIBC_ARCHSETJMP_H |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 58 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 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; |
| 79 | }; |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 80 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 81 | typedef struct __jmp_buf jmp_buf[1]; |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 82 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 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 @@ |
| 92 | /* |
| 93 | - * arch/x86_64/include/klibc/archsetjmp.h |
| 94 | + * arch/m32r/include/klibc/archsetjmp.h |
| 95 | */ |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 96 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 97 | #ifndef _KLIBC_ARCHSETJMP_H |
| 98 | #define _KLIBC_ARCHSETJMP_H |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 99 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 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; |
| 113 | }; |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 114 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 115 | typedef struct __jmp_buf jmp_buf[1]; |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 116 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 117 | -#endif /* _SETJMP_H */ |
| 118 | +#endif /* _KLIBC_ARCHSETJMP_H */ |
Junio C Hamano | a9a3e82 | 2008-07-09 19:58:23 -0700 | [diff] [blame] | 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. |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 136 | EOF |
| 137 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 138 | find klibc -type f -print | xargs git update-index --add -- |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 139 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 140 | test_expect_success 'check rename/copy patch' 'git apply --check patch' |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 141 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 142 | test_expect_success 'apply rename/copy patch' 'git apply --index patch' |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 143 | |
| 144 | test_done |