From 1b6d1941dc5b589632c254ee6e960404d7cef5f2 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 27 Sep 2012 17:11:05 -0600 Subject: dtc: cpp co-existence: add support for #line directives Line control directives of the following formats are supported: #line LINE "FILE" # LINE "FILE" [FLAGS] This allows dtc to consume the output of pre-processors, and to provide error messages that refer to the original filename, including taking into account any #include directives that the pre-processor may have performed. Signed-off-by: Stephen Warren Acked-by: David Gibson --- tests/line_directives.dts | 11 +++++++++++ tests/run_tests.sh | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 tests/line_directives.dts (limited to 'tests') diff --git a/tests/line_directives.dts b/tests/line_directives.dts new file mode 100644 index 0000000..e9d0800 --- /dev/null +++ b/tests/line_directives.dts @@ -0,0 +1,11 @@ +/dts-v1/; + +/* common format */ +#line 3 "foo.dts" +/* newer gcc format */ +# 9 "baz.dts" 1 +/* flags are optional */ +# 6 "bar.dts" + +/ { +}; diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 7d7a5f7..9ca45c9 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -257,6 +257,8 @@ dtc_tests () { run_dtc_test -I dts -O dtb -o dtc_escapes.test.dtb propname_escapes.dts run_test propname_escapes dtc_escapes.test.dtb + run_dtc_test -I dts -O dtb -o line_directives.test.dtb line_directives.dts + run_dtc_test -I dts -O dtb -o dtc_escapes.test.dtb escapes.dts run_test string_escapes dtc_escapes.test.dtb -- cgit v1.2.1