Debian Codegraph @

gcc/testsuite/g++.target/riscv/mv-symbols5.C

raw
1 /* { dg-do compile } */
2 /* { dg-require-ifunc "" } */
3 /* { dg-options "-O0 -march=rv64gc -mabi=lp64" } */
4
5 __attribute__((target_version("default")))
6 int foo ();
7
8 __attribute__((target_version("arch=+v")))
9 int foo ()
10 {
11 return 3;
12 }
13
14 __attribute__((target_version("arch=+zba,+zbb")))
15 int foo ()
16 {
17 return 5;
18 }
19
20 __attribute__((target_version("default")))
21 int foo (int);
22
23 __attribute__((target_version("arch=+v")))
24 int foo (int)
25 {
26 return 4;
27 }
28
29 __attribute__((target_version("arch=+zba,+zbb")))
30 int foo (int)
31 {
32 return 6;
33 }
34
35
36 int bar()
37 {
38 return foo ();
39 }
40
41 /* When updating any of the symbol names in these tests, make sure to also
42 update any tests for their absence in mv-symbolsN.C */
43
44 /* { dg-final { scan-assembler ".attribute arch, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0\"" } } */
45 /* { dg-final { scan-assembler-times ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_v1p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0" 2 } } */
46 /* { dg-final { scan-assembler-times ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zba1p0_zbb1p0" 2 } } */
47
48 /* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */
49 /* { dg-final { scan-assembler-times "\n_Z3foov\.arch__v:\n" 1 } } */
50 /* { dg-final { scan-assembler-times "\n_Z3foov\.arch__zba__zbb:\n" 1 } } */
51 /* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 1 } } */
52 /* { dg-final { scan-assembler-times "\n\tcall\t_Z3foov(?:@plt)?\n" 1 } } */
53 /* { dg-final { scan-assembler-times "\n\t\.type\t_Z3foov, @gnu_indirect_function\n" 1 } } */
54 /* { dg-final { scan-assembler-times "\n\t\.set\t_Z3foov,_Z3foov\.resolver\n" 1 } } */
55
56 /* { dg-final { scan-assembler-times "\n_Z3fooi\.default:\n" 0 } } */
57 /* { dg-final { scan-assembler-times "\n_Z3fooi\.arch__v:\n" 1 } } */
58 /* { dg-final { scan-assembler-times "\n_Z3fooi\.arch__zba__zbb:\n" 1 } } */
59 /* { dg-final { scan-assembler-times "\n_Z3fooi\.resolver:\n" 0 } } */
60 /* { dg-final { scan-assembler-times "\n\tcall\t_Z3fooi(?:@plt)?\n" 0 } } */
61 /* { dg-final { scan-assembler-times "\n\t\.type\t_Z3fooi, @gnu_indirect_function\n" 0 } } */
62 /* { dg-final { scan-assembler-times "\n\t\.set\t_Z3fooi,_Z3fooi\.resolver\n" 0 } } */