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 | |
Ævar Arnfjörð Bjarmason | f54f48f | 2021-10-31 00:24:18 +0200 | [diff] [blame] | 10 | |
| 11 | TEST_PASSES_SANITIZE_LEAK=true |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 12 | . ./test-lib.sh |
| 13 | |
| 14 | # setup |
| 15 | |
Junio C Hamano | b7a036b | 2006-07-26 11:01:07 -0700 | [diff] [blame] | 16 | mkdir -p klibc/arch/x86_64/include/klibc |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 17 | |
| 18 | cat >klibc/arch/x86_64/include/klibc/archsetjmp.h <<\EOF |
| 19 | /* |
| 20 | * arch/x86_64/include/klibc/archsetjmp.h |
| 21 | */ |
| 22 | |
| 23 | #ifndef _KLIBC_ARCHSETJMP_H |
| 24 | #define _KLIBC_ARCHSETJMP_H |
| 25 | |
| 26 | struct __jmp_buf { |
| 27 | unsigned long __rbx; |
| 28 | unsigned long __rsp; |
| 29 | unsigned long __rbp; |
| 30 | unsigned long __r12; |
| 31 | unsigned long __r13; |
| 32 | unsigned long __r14; |
| 33 | unsigned long __r15; |
| 34 | unsigned long __rip; |
| 35 | }; |
| 36 | |
| 37 | typedef struct __jmp_buf jmp_buf[1]; |
| 38 | |
| 39 | #endif /* _SETJMP_H */ |
| 40 | EOF |
Junio C Hamano | a9a3e82 | 2008-07-09 19:58:23 -0700 | [diff] [blame] | 41 | cat >klibc/README <<\EOF |
| 42 | This is a simple readme file. |
| 43 | EOF |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 44 | |
| 45 | cat >patch <<\EOF |
| 46 | diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/cris/klibc/archsetjmp.h |
| 47 | similarity index 76% |
| 48 | copy from klibc/arch/x86_64/include/klibc/archsetjmp.h |
| 49 | copy to include/arch/cris/klibc/archsetjmp.h |
| 50 | --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h |
| 51 | +++ b/include/arch/cris/klibc/archsetjmp.h |
| 52 | @@ -1,21 +1,24 @@ |
| 53 | /* |
| 54 | - * arch/x86_64/include/klibc/archsetjmp.h |
| 55 | + * arch/cris/include/klibc/archsetjmp.h |
| 56 | */ |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 57 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 58 | #ifndef _KLIBC_ARCHSETJMP_H |
| 59 | #define _KLIBC_ARCHSETJMP_H |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 60 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 61 | struct __jmp_buf { |
| 62 | - unsigned long __rbx; |
| 63 | - unsigned long __rsp; |
| 64 | - unsigned long __rbp; |
| 65 | - unsigned long __r12; |
| 66 | - unsigned long __r13; |
| 67 | - unsigned long __r14; |
| 68 | - unsigned long __r15; |
| 69 | - unsigned long __rip; |
| 70 | + unsigned long __r0; |
| 71 | + unsigned long __r1; |
| 72 | + unsigned long __r2; |
| 73 | + unsigned long __r3; |
| 74 | + unsigned long __r4; |
| 75 | + unsigned long __r5; |
| 76 | + unsigned long __r6; |
| 77 | + unsigned long __r7; |
| 78 | + unsigned long __r8; |
| 79 | + unsigned long __sp; |
| 80 | + unsigned long __srp; |
| 81 | }; |
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 | typedef struct __jmp_buf jmp_buf[1]; |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 84 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 85 | -#endif /* _SETJMP_H */ |
| 86 | +#endif /* _KLIBC_ARCHSETJMP_H */ |
| 87 | diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/m32r/klibc/archsetjmp.h |
| 88 | similarity index 66% |
| 89 | rename from klibc/arch/x86_64/include/klibc/archsetjmp.h |
| 90 | rename to include/arch/m32r/klibc/archsetjmp.h |
| 91 | --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h |
| 92 | +++ b/include/arch/m32r/klibc/archsetjmp.h |
| 93 | @@ -1,21 +1,21 @@ |
| 94 | /* |
| 95 | - * arch/x86_64/include/klibc/archsetjmp.h |
| 96 | + * arch/m32r/include/klibc/archsetjmp.h |
| 97 | */ |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 98 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 99 | #ifndef _KLIBC_ARCHSETJMP_H |
| 100 | #define _KLIBC_ARCHSETJMP_H |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 101 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 102 | struct __jmp_buf { |
| 103 | - unsigned long __rbx; |
| 104 | - unsigned long __rsp; |
| 105 | - unsigned long __rbp; |
| 106 | + unsigned long __r8; |
| 107 | + unsigned long __r9; |
| 108 | + unsigned long __r10; |
| 109 | + unsigned long __r11; |
| 110 | unsigned long __r12; |
| 111 | unsigned long __r13; |
| 112 | unsigned long __r14; |
| 113 | unsigned long __r15; |
| 114 | - unsigned long __rip; |
| 115 | }; |
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 | typedef struct __jmp_buf jmp_buf[1]; |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 118 | |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 119 | -#endif /* _SETJMP_H */ |
| 120 | +#endif /* _KLIBC_ARCHSETJMP_H */ |
Junio C Hamano | a9a3e82 | 2008-07-09 19:58:23 -0700 | [diff] [blame] | 121 | diff --git a/klibc/README b/klibc/README |
| 122 | --- a/klibc/README |
| 123 | +++ b/klibc/README |
| 124 | @@ -1,1 +1,4 @@ |
| 125 | This is a simple readme file. |
| 126 | +And we add a few |
| 127 | +lines at the |
| 128 | +end of it. |
| 129 | diff --git a/klibc/README b/klibc/arch/README |
| 130 | copy from klibc/README |
| 131 | copy to klibc/arch/README |
| 132 | --- a/klibc/README |
| 133 | +++ b/klibc/arch/README |
| 134 | @@ -1,1 +1,3 @@ |
| 135 | This is a simple readme file. |
| 136 | +And we copy it to one level down, and |
| 137 | +add a few lines at the end of it. |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 138 | EOF |
| 139 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 140 | find klibc -type f -print | xargs git update-index --add -- |
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 'check rename/copy patch' 'git apply --check patch' |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 143 | |
Junio C Hamano | 5be6007 | 2007-07-02 22:52:14 -0700 | [diff] [blame] | 144 | test_expect_success 'apply rename/copy patch' 'git apply --index patch' |
Junio C Hamano | 52be5fc | 2005-09-04 15:40:18 -0700 | [diff] [blame] | 145 | |
| 146 | test_done |