MSP430: Read MCU data from external file
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Tue, 13 Aug 2019 10:31:17 +0000 (10:31 +0000)
committerJozef Lawrynowicz <jozefl@gcc.gnu.org>
Tue, 13 Aug 2019 10:31:17 +0000 (10:31 +0000)
commitd5c949950c8941e945b08e82181b52a208fa3af4
tree51cf70166889421fecd2420275c15f31a6aba84a
parent1044fa32e2b456b59b3cdc31b4f261145f1589cc
MSP430: Read MCU data from external file

gcc/ChangeLog:

2019-08-13  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

* config/msp430/driver-msp430.c (msp430_set_driver_var): New.
* config/msp430/msp430-devices.c (canonicalize_path_dirsep): New.
(msp430_check_path_for_devices): New.
(parse_devices_csv_1): New.
(parse_devices_csv): New.
(msp430_extract_mcu_data): Try to find devices.csv and search for the
MCU data in devices.csv before using the hard-coded data.
Warn if devices.csv isn't found and the MCU wasn't found in the
hard-coded data either.
* config/msp430/msp430.h (DRIVER_SELF_SPECS): Call
msp430_set_driver_var for -mno-warn-devices-csv and -mdevices-csv-loc.
Search for devices.csv on -I and -L paths.
(EXTRA_SPEC_FUNCTIONS): Add msp430_check_path_for_devices and
msp430_set_driver_var.
* config/msp430/msp430.opt: Add -mwarn-devices-csv and
-mdevices-csv-loc=.
* doc/invoke.texi (-mmcu): Document that -I and -L paths are
searched for devices.csv.
(mwarn-devices-csv): Document option.

gcc/testsuite/ChangeLog:

2019-08-13  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

* gcc.target/msp430/msp430.exp (msp430_device_permutations_runtest):
Handle csv-* and bad-devices-* tests.
* gcc.target/msp430/devices/README: Document how bad-devices-* tests
work.
* gcc.target/msp430/devices/bad-devices-1.c: New test.
* gcc.target/msp430/devices/bad-devices-2.c: Likewise.
* gcc.target/msp430/devices/bad-devices-3.c: Likewise.
* gcc.target/msp430/devices/bad-devices-4.c: Likewise.
* gcc.target/msp430/devices/bad-devices-5.c: Likewise.
* gcc.target/msp430/devices/bad-devices-6.c: Likewise.
* gcc.target/msp430/devices/csv-device-order.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_00.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_01.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_02.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_04.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_08.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_10.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_11.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_12.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_14.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_18.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_20.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_21.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_22.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_24.c: Likewise.
* gcc.target/msp430/devices/csv-msp430_28.c: Likewise.
* gcc.target/msp430/devices/csv-msp430fr5969.c: Likewise.
* gcc.target/msp430/devices/hard-foo.c: Likewise.
* gcc.target/msp430/devices/bad-devices-1.csv: New test support file.
* gcc.target/msp430/devices/bad-devices-2.csv: Likewise.
* gcc.target/msp430/devices/bad-devices-3.csv: Likewise.
* gcc.target/msp430/devices/bad-devices-4.csv: Likewise.
* gcc.target/msp430/devices/bad-devices-5.csv: Likewise.
* gcc.target/msp430/devices/bad-devices-6.csv: Likewise.
* gcc.target/msp430/devices/devices.csv: Likewise.

From-SVN: r274373
40 files changed:
gcc/ChangeLog
gcc/config/msp430/driver-msp430.c
gcc/config/msp430/msp430-devices.c
gcc/config/msp430/msp430.h
gcc/config/msp430/msp430.opt
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/msp430/devices/README
gcc/testsuite/gcc.target/msp430/devices/bad-devices-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-1.csv [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-2.csv [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-3.csv [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-4.csv [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-5.csv [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/bad-devices-6.csv [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-device-order.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_00.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_01.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_02.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_04.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_08.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_14.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_18.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_20.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_21.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_22.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_24.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430_28.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/csv-msp430fr5969.c [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/devices.csv [new file with mode: 0644]
gcc/testsuite/gcc.target/msp430/devices/hard-foo.c
gcc/testsuite/gcc.target/msp430/msp430.exp