File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1429,8 +1429,9 @@ Expr ScriptParser::readPrimary() {
1429
1429
return [=] { return *val; };
1430
1430
1431
1431
// Tok is a symbol name.
1432
- tok = unquote (tok);
1433
- if (!isValidSymbolName (tok))
1432
+ if (tok.startswith (" \" " ))
1433
+ tok = unquote (tok);
1434
+ else if (!isValidSymbolName (tok))
1434
1435
setError (" malformed number: " + tok);
1435
1436
script->referencedSymbols .push_back (tok);
1436
1437
return [=] { return script->getSymbolValue (tok, location); };
Original file line number Diff line number Diff line change 1
1
# REQUIRES: x86
2
- ## Test that ., $ and " can be used by symbol names in expressions.
2
+ ## Test that ., $, space and " can be used by symbol names in expressions.
3
3
4
4
# RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o %t.o
5
5
# RUN: ld.lld -T %s %t.o -o %t
8
8
# CHECK: Value Size Type Bind Vis Ndx Name
9
9
# CHECK-DAG: 0000000000000000 0 NOTYPE GLOBAL DEFAULT ABS a1
10
10
# CHECK-DAG: 0000000000000000 0 NOTYPE GLOBAL DEFAULT ABS a0
11
- # CHECK-DAG: 0000000000000003 0 NOTYPE GLOBAL DEFAULT ABS a2
11
+ # CHECK-DAG: 0000000000000003 0 NOTYPE GLOBAL DEFAULT ABS a 2
12
+ # CHECK-DAG: 0000000000000004 0 NOTYPE GLOBAL DEFAULT ABS a 3
12
13
13
14
a0 = DEFINED(.TOC.) ? .TOC. : 0;
14
15
"a1" = DEFINED(__global_pointer$) ? __global_pointer$ : 0;
15
- "a2" = DEFINED("a1") ? "a1" + 3 : 0;
16
+ "a 2" = DEFINED("a1") ? "a1" + 3 : 0;
17
+ "a 3" = "a 2" + 1;
You can’t perform that action at this time.
0 commit comments