Debian Codegraph @

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

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