Commit c3911e64 by Kito Cheng Committed by Kito Cheng

RISC-V: Check multiletter extension has more than 1 letter

gcc/ChangeLog:

	* common/config/riscv/riscv-common.c
	(riscv_subset_list::parse_multiletter_ext): Checking multiletter
	extension has more than 1 letter.

gcc/testsuite/ChangeLog

	* gcc.target/riscv/arch-7.c: New.
	* gcc.target/riscv/attribute-10.c: Update test arch string.
parent ccd34d41
......@@ -524,6 +524,14 @@ riscv_subset_list::parse_multiletter_ext (const char *p,
*q = '\0';
if (strlen (subset) == 1)
{
error_at (m_loc, "%<-march=%s%>: name of %s must be more than 1 letter",
m_arch, ext_type_str);
free (subset);
return NULL;
}
add (subset, major_version, minor_version, explicit_version_p);
free (subset);
p += end_of_version - subset;
......
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv32i -march=rv32im_s -mabi=ilp32" } */
int foo()
{
}
/* { dg-error ".'-march=rv32im_s': name of supervisor extension must be more than 1 letter" "" { target *-*-* } 0 } */
/* { dg-do compile } */
/* { dg-options "-O2 -march=rv32i -march=rv32im_s_sx_unexpectedstring -mabi=ilp32" } */
/* { dg-options "-O2 -march=rv32i -march=rv32im_sx_unexpectedstring -mabi=ilp32" } */
int foo()
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment