xref: /linux/tools/objtool/tests/generic/test-symvers-parse-error.sh (revision ade23d75deb3c679760c3f0f33d9b8d8ffa9f963)
1*ade23d75SSong Liu#!/bin/bash
2*ade23d75SSong Liu# SPDX-License-Identifier: GPL-2.0
3*ade23d75SSong Liu#
4*ade23d75SSong Liu# A malformed Module.symvers has to be reported against the line it is on.
5*ade23d75SSong Liu# Module.symvers has tens of thousands of lines and is generated, so a wrong
6*ade23d75SSong Liu# line number sends whoever has to fix it to the wrong place, and "line 1" is
7*ade23d75SSong Liu# wrong in a way that looks plausible.
8*ade23d75SSong Liu
9*ade23d75SSong Liu. "$(dirname "$0")/../lib.sh"
10*ade23d75SSong Liu
11*ade23d75SSong Liusetup
12*ade23d75SSong Liubuild_pair basic.c
13*ade23d75SSong Liu
14*ade23d75SSong Liu# Three well-formed lines, then one with no tabs at all.
15*ade23d75SSong Liuexport_syms a b c
16*ade23d75SSong Liuecho 'this line has no fields' >> "$workdir/Module.symvers"
17*ade23d75SSong Liu
18*ade23d75SSong Liurun_diff 255
19*ade23d75SSong Liu
20*ade23d75SSong Liuassert_diff_log 'malformed Module.symvers'
21*ade23d75SSong Liuassert_diff_log 'at line 4'
22*ade23d75SSong Liu
23*ade23d75SSong Liupass "malformed Module.symvers reported against the offending line"
24