--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */
+
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */
+
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo ()
+{
+ return 3;
+}
+__attribute__((target_version("strict-align")))
+int foo ()
+{
+ return 5;
+}
+
+int foo (int)
+{
+ return 2;
+}
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo (int)
+{
+ return 6;
+}
+
+__attribute__((target_version("strict-align")))
+int foo (int)
+{
+ return 4;
+}
+
+
+int bar()
+{
+ return foo ();
+}
+
+int bar(int x)
+{
+ return foo (x);
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } }*/
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */
+
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */
+
+
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo ()
+{
+ return 3;
+}
+
+__attribute__((target_version("strict-align")))
+int foo ()
+{
+ return 5;
+}
+
+int foo (int)
+{
+ return 2;
+}
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo (int)
+{
+ return 6;
+}
+
+__attribute__((target_version("strict-align")))
+int foo (int)
+{
+ return 4;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_0:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.strict_align:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */
+
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_0:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.strict_align:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */
+
+__attribute__((target_version("default")))
+int foo ();
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo ();
+
+__attribute__((target_version("strict-align")))
+int foo ();
+
+__attribute__((target_version("default")))
+int foo (int);
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo (int);
+
+__attribute__((target_version("strict-align")))
+int foo (int);
+
+int bar()
+{
+ return foo ();
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_0:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.strict_align:\n" } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */
+
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_0:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.strict_align:\n" } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */
+
+__attribute__((target_version("default")))
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo ();
+
+__attribute__((target_version("strict-align")))
+int foo ();
+
+__attribute__((target_version("default")))
+int foo (int)
+{
+ return 2;
+}
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo (int);
+
+__attribute__((target_version("strict-align")))
+int foo (int);
+
+
+int bar()
+{
+ return foo ();
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */
+
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */
+
+
+__attribute__((target_version("default")))
+int foo ();
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo ()
+{
+ return 3;
+}
+__attribute__((target_version("strict-align")))
+int foo ()
+{
+ return 5;
+}
+
+__attribute__((target_version("default")))
+int foo (int);
+
+__attribute__((target_version("arch=la64v1.0")))
+int foo (int)
+{
+ return 6;
+}
+
+__attribute__((target_version("strict-align")))
+int foo (int)
+{
+ return 4;
+}
+
+
+int bar()
+{
+ return foo ();
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_0_priority_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.strict_align_priority_2:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */
+
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_0_priority_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.strict_align_priority_2:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */
+
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_version("arch=la64v1.0;priority=1")))
+int foo ()
+{
+ return 3;
+}
+__attribute__((target_version("strict-align;priority=2")))
+int foo ()
+{
+ return 5;
+}
+
+int foo (int)
+{
+ return 2;
+}
+
+__attribute__((target_version("arch=la64v1.0;priority=1")))
+int foo (int)
+{
+ return 6;
+}
+
+__attribute__((target_version("strict-align;priority=2")))
+int foo (int)
+{
+ return 4;
+}
+
+
+int bar()
+{
+ return foo ();
+}
+
+int bar(int x)
+{
+ return foo (x);
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.lsx:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */
+
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.lsx:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo (int)
+{
+ return 2;
+}
+
+
+int bar()
+{
+ return foo ();
+}
+
+int bar(int x)
+{
+ return foo (x);
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.lsx:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */
+
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.lsx:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo (int)
+{
+ return 2;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_1:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.lsx:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */
+
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_1:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.lsx:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo ();
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo (int);
+
+
+int bar()
+{
+ return foo ();
+}
+
+int bar(int x)
+{
+ return foo (x);
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.default:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.arch_la64v1_1:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.lsx:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3foov\.resolver:\n" } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3foov, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3foov,_Z3foov\.resolver" } } */
+
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.default:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.arch_la64v1_1:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.lsx:\n" } } */
+/* { dg-final { scan-assembler-not "\n_Z3fooi\.resolver:\n" } } */
+/* { dg-final { scan-assembler-not "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" } } */
+/* { dg-final { scan-assembler-not "\t\.type\t_Z3fooi, @gnu_indirect_function" } } */
+/* { dg-final { scan-assembler-not "\t\.set\t_Z3fooi,_Z3fooi\.resolver" } } */
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo ();
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx")))
+int foo (int);
+
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-options "-O0 -march=loongarch64 -mabi=lp64d -mcmodel=normal" } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.arch_la64v1_1_priority_3:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.lsx:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3foov\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3foov, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3foov,_Z3foov\.resolver" 1 } } */
+
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.arch_la64v1_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.lsx_priority_1:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 1 } } */
+/* { dg-final { scan-assembler-times "\tbl\t\\\%plt\\\(_Z3fooi\\\)\n" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.type\t_Z3fooi, @gnu_indirect_function" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.set\t_Z3fooi,_Z3fooi\.resolver" 1 } } */
+
+__attribute__((target_clones("default", "arch=la64v1.1;priority=3", "lsx")))
+int foo ()
+{
+ return 1;
+}
+
+__attribute__((target_clones("default", "arch=la64v1.1", "lsx;priority=1")))
+int foo (int)
+{
+ return 2;
+}
+
+
+int bar()
+{
+ return foo ();
+}
+
+int bar(int x)
+{
+ return foo (x);
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default;priority=1","lsx"))) void
+test (void) /* { dg-error "\\\"default\\\" cannot be set together with other features in \\\'default;priority=1\\\'" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default","lsx;"))) void
+test (void) /* { dg-error "in attribute \\\'lsx;\\\' priority cannot be empty" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default",";priority=1"))) void
+test (void) /* { dg-error "characher before \\\';\\\' in attribute \\\';priority=1\\\' cannot be empty" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default","lsx;priority=1;lasx"))) void
+test (void) /* { dg-error "in attribute \\\'lsx;priority=1;lasx\\\' the number of reatures cannot exceed two" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default","lsx;priority=-1"))) void
+test (void) /* { dg-error "Setting the priority value to \\\'-1\\\' is illegal in attribute \\\'lsx;priority=-1\\\'" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default","lsx;lasx"))) void
+test (void) /* { dg-error "in attribute \\\'lsx;lasx\\\', the second feature should be \\\"priority=\\\'num\\\'\\\" instead of \\\'lasx\\\'" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default","arch="))) void
+test (void) /* { dg-error "in attribute \\\'arch=\\\' you need to set a legal value for \\\"arch\\\"" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default","cmodel=normal"))) void
+test (void) /* { dg-error "attribute \\\'cmodel=normal\\\' is not supported in \\\'target_version\\\' or \\\'target_clones\\\'" } */
+{}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wno-attributes" } */
+
+__attribute__ ((target_clones ("default","123456"))) void
+test (void) /* { dg-error "\\\'123456\\\' is not supported in target attribute" } */
+{}