Debian Codegraph @

gcc/testsuite/gcc.target/nvptx/alloca-1-O0_-mfake-ptx-alloca.c

raw
1 /* { dg-do assemble } */
2 /* { dg-options {-O0 -mno-soft-stack} } */
3 /* { dg-additional-options -march=sm_30 } */
4 /* { dg-additional-options -mfake-ptx-alloca } */
5 /* { dg-additional-options -save-temps } */
6 /* { dg-final { check-function-bodies {** } {} } } */
7
8 void sink(void *);
9
10 void f(void)
11 {
12 sink(__builtin_alloca(123));
13 /* { dg-bogus {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
14 }
15 /*
16 ** f:
17 ** \.visible \.func f
18 ** {
19 ** \.reg\.u64 (%r[0-9]+);
20 ** \.reg\.u64 (%r[0-9]+);
21 ** \.reg\.u64 (%r[0-9]+);
22 ** \.reg\.u64 (%r[0-9]+);
23 ** \.reg\.u64 (%r[0-9]+);
24 ** \.reg\.u64 (%r[0-9]+);
25 ** \.reg\.u64 (%r[0-9]+);
26 ** \.reg\.u64 (%r[0-9]+);
27 ** \.reg\.u64 (%r[0-9]+);
28 ** \.reg\.u64 (%r[0-9]+);
29 ** \.reg\.u64 (%r[0-9]+);
30 ** mov\.u64 \11, 16;
31 ** add\.u64 \2, \11, -1;
32 ** add\.u64 \3, \2, 123;
33 ** div\.u64 \4, \3, 16;
34 ** mul\.lo\.u64 \5, \4, 16;
35 ** call \(\6\), __GCC_nvptx__PTX_alloca_not_supported, \(\5\);
36 ** add\.u64 \7, \6, 15;
37 ** shr\.u64 \8, \7, 4;
38 ** shl\.b64 \9, \8, 4;
39 ** mov\.u64 \1, \9;
40 ** mov\.u64 \10, \1;
41 ** {
42 ** \.param\.u64 %out_arg1;
43 ** st\.param\.u64 \[%out_arg1\], \10;
44 ** call sink, \(%out_arg1\);
45 ** }
46 ** ret;
47 */
48
49 /* { dg-final { scan-assembler-times {(?n)^\.extern \.func \(\.param\.u64 %value_out\) __GCC_nvptx__PTX_alloca_not_supported \(\.param\.u64 %in_ar0\);$} 1 } } */