module &module:1:0:$full:$large:$default; /* Tests for alloca. */ /* { dg-do compile } */ /* { dg-options "-fdump-tree-gimple" } */ prog function &subfunction(arg_u32 %return_value)() { alloca_align(1)_u32 $s2, 256; st_arg_u32 $s2, [%return_value]; ret; }; prog kernel &kernel(kernarg_u64 %input_ptr, kernarg_u64 %output_ptr) { ld_kernarg_u64 $d0, [%input_ptr]; ld_global_u32 $s0, [$d0]; alloca_align(256)_u32 $s1, 16; { arg_u32 %return_value; call &subfunction(%return_value)(); ld_arg_u32 $s1, [%return_value]; } ld_kernarg_u64 $d1, [%output_ptr]; st_global_u32 $s1, [$d0]; }; /* { dg-final { scan-tree-dump "s2 = __builtin___hsail_alloca \\\(256, 1, __context\\\);" "gimple" } } */ /* { dg-final { scan-tree-dump "s1 = __builtin___hsail_alloca \\\(16, 256, __context\\\);" "gimple" } } */ /* Both functions should have an alloca frame push and pop. */ /* { dg-final { scan-tree-dump-times "__builtin___hsail_alloca_push_frame \\\(__context\\\);" 2 "gimple" } } */ /* { dg-final { scan-tree-dump-times "__builtin___hsail_alloca_pop_frame \\\(__context\\\);" 2 "gimple" } } */