File tree Expand file tree Collapse file tree 9 files changed +75
-76
lines changed
lld/test/ELF/linkerscript Expand file tree Collapse file tree 9 files changed +75
-76
lines changed Original file line number Diff line number Diff line change
1
+ # REQUIRES: x86
2
+ # RUN: rm -rf %t && split-file %s %t && cd %t
3
+ # RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o 0.o
4
+
5
+ #--- 1.lds
6
+ SECTIONS {
7
+ .text + { *(.text) }
8
+ .keep : { *(.keep) } /*
9
+ comment line 1
10
+ comment line 2 */
11
+ .temp : { *(.temp) }
12
+ }
13
+
14
+ # RUN: not ld.lld -shared 0.o -T 1.lds 2>&1 | FileCheck %s --check-prefix=CHECK1 --match-full-lines --strict-whitespace
15
+ # CHECK1:{{.*}}:2: malformed number: +
16
+ # CHECK1-NEXT:>>> .text + { *(.text) }
17
+ # CHECK1-NEXT:>>> ^
18
+
19
+ #--- 2.lds
20
+
21
+ UNKNOWN_TAG {
22
+ .text : { *(.text) }
23
+ .keep : { *(.keep) }
24
+ .temp : { *(.temp) }
25
+ }
26
+
27
+ # RUN: not ld.lld -shared 0.o -T 2.lds 2>&1 | FileCheck %s --check-prefix=CHECK2 --match-full-lines --strict-whitespace
28
+ # CHECK2:{{.*}}:2: unknown directive: UNKNOWN_TAG
29
+ # CHECK2-NEXT:>>> UNKNOWN_TAG {
30
+ # CHECK2-NEXT:>>> ^
31
+
32
+ #--- 3.lds
33
+ SECTIONS {
34
+ .text : { *(.text) }
35
+ .keep : { *(.keep) }
36
+ boom ^temp : { *(.temp) }
37
+ }
38
+ #--- 3a.lds
39
+ INCLUDE "3.lds"
40
+ #--- 3b.lds
41
+ foo = 3;
42
+ INCLUDE "3a.lds"
43
+
44
+ # RUN: not ld.lld -shared 0.o -T 3.lds 2>&1 | FileCheck %s --check-prefix=CHECK3 --match-full-lines --strict-whitespace
45
+ # RUN: not ld.lld -shared 0.o -T 3a.lds 2>&1 | FileCheck %s --check-prefix=CHECK3 --match-full-lines --strict-whitespace
46
+ # RUN: not ld.lld -shared 0.o -T 3b.lds 2>&1 | FileCheck %s --check-prefix=CHECK3 --match-full-lines --strict-whitespace
47
+ # CHECK3:{{.*}}3.lds:4: malformed number: ^
48
+ # CHECK3-NEXT:>>> boom ^temp : { *(.temp) }
49
+ # CHECK3-NEXT:>>> ^
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # REQUIRES: x86
2
+ # RUN: rm -rf %t && split-file %s %t && cd %t
3
+ # RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o 0.o
4
+
5
+ #--- empty.lds
6
+ #--- 1.lds
7
+
8
+ SECTIONS /*
9
+ #--- 1a.lds
10
+ foo = 3;
11
+ INCLUDE "empty.lds"
12
+ INCLUDE "1.lds"
13
+
14
+ # RUN: not ld.lld -shared 0.o -T 1.lds 2>&1 | FileCheck %s --check-prefix=CHECK1 --match-full-lines --strict-whitespace
15
+ # RUN: not ld.lld -shared 0.o -T 1a.lds 2>&1 | FileCheck %s --check-prefix=CHECK1A --match-full-lines --strict-whitespace
16
+ # CHECK1:{{.*}}error: 1.lds:1: unclosed comment in a linker script
17
+ # CHECK1A:{{.*}}error: 1a.lds:3: unclosed comment in a linker script
18
+ #CHECK1A-NEXT:>>> INCLUDE "1.lds"
19
+ #CHECK1A-NEXT:>>> ^
20
+
21
+ #--- 2.lds
22
+ INCLUDE "empty.lds"
23
+ "
24
+ # RUN: not ld.lld -shared 0.o -T 2.lds 2>&1 | FileCheck %s --check-prefix=CHECK2 --match-full-lines --strict-whitespace
25
+ # CHECK2:{{.*}}error: 2.lds:2: unclosed quote
26
+ # CHECK2-NOT:{{.}}
You can’t perform that action at this time.
0 commit comments