Alexander Shaposhnikov | e60a760 | 2020-09-24 01:48:21 -0700 | [diff] [blame^] | 1 | ## Test --add-section error messages. |
| 2 | |
| 3 | # RUN: yaml2obj %p/Inputs/x86_64.yaml -o %t |
| 4 | # RUN: echo -n abcdefg > %t.data |
| 5 | |
| 6 | ## Error case 1: Nonexistent input file is specified by --add-section. |
| 7 | # RUN: not llvm-objcopy --add-section __TEXT,__text=%t.missing %t %t.nonexistent-file 2>&1 \ |
| 8 | # RUN: | FileCheck %s -DINPUT=%t -DSECTION_DATA_FILE=%t.missing --check-prefix=NONEXSITENT-FILE |
| 9 | # NONEXSITENT-FILE: error: '[[INPUT]]': '[[SECTION_DATA_FILE]]': {{[Nn]}}o such file or directory |
| 10 | |
| 11 | ## Error case 2: Too long segment name. |
| 12 | # RUN: not llvm-objcopy --add-section __TOOOOOOOOO_LONG,__text=%t.data %t %t.too-long-seg-name 2>&1 \ |
| 13 | # RUN: | FileCheck %s -DINPUT=%t --check-prefix=TOO-LONG-SEG-NAME |
| 14 | # TOO-LONG-SEG-NAME: error: '[[INPUT]]': too long segment name: '__TOOOOOOOOO_LONG' |