frameworks/compile/slang/lit-tests/P_ref_count/ref_count2.rscript

18 lines
510 B
Plaintext
Raw Permalink Normal View History

2025-08-25 08:17:13 +08:00
// RUN: %Slang %s
// RUN: %rs-filecheck-wrapper %s
#pragma version(1)
#pragma rs java_package_name(ref_count2)
// CHECK: %[[RETVAL:[A-Za-z][A-Za-z0-9]*]] = call i32 @_Z18rsGetElementAt_int13rs_allocationj{{.*}}
// CHECK: call void @_Z13rsClearObjectP13rs_allocation(%struct.rs_allocation{{.*}}* {{.*}})
// CHECK: ret i32 %[[RETVAL]]
static int goo(rs_allocation a) {
return rsGetElementAt_int(a, 0);
}
void entrypoint() {
rs_allocation a = rsCreateAllocation_int(100);
rsDebug("val at 0:", goo(a));
}