Debian Codegraph @

gcc/testsuite/gcc.target/nvptx/alloca-4-O3_-mfake-ptx-alloca.c

raw
1 /* { dg-do assemble } */
2 /* { dg-options {-O3 -mno-soft-stack} } */
3 /* { dg-additional-options {-march=sm_30 -mfake-ptx-alloca} } */
4 /* { dg-additional-options -save-temps } */
5 /* { dg-final { check-function-bodies {** } {} } } */
6
7 void sink(void *);
8
9 void f(void)
10 {
11 void *p;
12 p = __builtin_stack_save();
13 sink(__builtin_alloca(25));
14 /* { dg-bogus {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
15 __builtin_stack_restore(p);
16 sink(__builtin_alloca(13));
17 /* { dg-bogus {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
18 }
19 /*
20 ** f:
21 ** .visible .func f
22 ** {
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 ** call \(\1\), __GCC_nvptx__PTX_alloca_not_supported, \(32\);
30 ** add\.u64 \2, \1, 15;
31 ** and\.b64 \3, \2, -16;
32 ** {
33 ** \.param\.u64 %out_arg1;
34 ** st\.param\.u64 \[%out_arg1\], \3;
35 ** call sink, \(%out_arg1\);
36 ** }
37 ** call \(\4\), __GCC_nvptx__PTX_alloca_not_supported, \(16\);
38 ** add\.u64 \5, \4, 15;
39 ** and\.b64 \6, \5, -16;
40 ** {
41 ** \.param\.u64 %out_arg1;
42 ** st\.param\.u64 \[%out_arg1\], \6;
43 ** call sink, \(%out_arg1\);
44 ** }
45 ** ret;
46 */
47
48 /* { dg-final { scan-assembler-times {(?n)^\.extern \.func \(\.param\.u64 %value_out\) __GCC_nvptx__PTX_alloca_not_supported \(\.param\.u64 %in_ar0\);$} 1 } } */