Skip to content

Commit fb8d61d

Browse files
committed
provide synthetic opt
Created using spr 1.3.4
1 parent b6b5e29 commit fb8d61d

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

bolt/test/X86/callcont-fallthru.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# RUN: link_fdata %s %t %t.pa3 PREAGG3
1010
# RUN: link_fdata %s %t %t.pat PREAGGT1
1111
# RUN: link_fdata %s %t %t.pat2 PREAGGT2
12-
# RUN: link_fdata %s %t %t.patplt PREAGGPLT --nmtool llvm-nm
12+
# RUN: link_fdata %s %t %t.patplt PREAGGPLT --synthetic
1313

1414
## Check normal case: fallthrough is not LP or secondary entry.
1515
# RUN: llvm-strip --strip-unneeded %t -o %t.strip

bolt/test/link_fdata.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
parser.add_argument("--nmtool", default="nm", help="Path to nm tool")
2222
parser.add_argument("--no-lbr", action="store_true")
2323
parser.add_argument("--no-redefine", action="store_true")
24+
parser.add_argument("--synthetic", action="store_true")
2425

2526
args = parser.parse_args()
2627

@@ -85,17 +86,10 @@
8586
exit("ERROR: unexpected input:\n%s" % line)
8687

8788
# Read nm output: <symbol value> <symbol type> <symbol name>
88-
is_llvm_nm = os.path.basename(args.nmtool) == "llvm-nm"
89-
nm_output = subprocess.run(
90-
[
91-
args.nmtool,
92-
"--defined-only",
93-
"--special-syms" if is_llvm_nm else "--synthetic",
94-
args.objfile,
95-
],
96-
text=True,
97-
capture_output=True,
98-
).stdout
89+
nm_args = [args.nmtool, "--defined-only", args.objfile]
90+
if args.synthetic:
91+
nm_args += ["--synthetic"]
92+
nm_output = subprocess.run(nm_args, text=True, capture_output=True).stdout
9993
# Populate symbol map
10094
symbols = {}
10195
for symline in nm_output.splitlines():

0 commit comments

Comments
 (0)