From d718da21a9a803b9c3515beaadf762720710299d Mon Sep 17 00:00:00 2001 From: Gary Frost <frost.gary@gmail.com> Date: Wed, 31 Oct 2012 20:59:51 +0000 Subject: [PATCH] Added test cases for issue #74: Thanks Eric. --- .../amd/aparapi/test/CallObjectStatic.java | 5 +- .../test/CallStaticInAnotherClass.java | 53 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 test/codegen/src/java/com/amd/aparapi/test/CallStaticInAnotherClass.java diff --git a/test/codegen/src/java/com/amd/aparapi/test/CallObjectStatic.java b/test/codegen/src/java/com/amd/aparapi/test/CallObjectStatic.java index 34bc6efe..23c66c2d 100644 --- a/test/codegen/src/java/com/amd/aparapi/test/CallObjectStatic.java +++ b/test/codegen/src/java/com/amd/aparapi/test/CallObjectStatic.java @@ -24,6 +24,9 @@ int passid; int get_pass_id(This *this){ return this->passid; } +int com_amd_aparapi_test_CallObjectStatic$Dummy__foo(){ + return(42); +} __kernel void run( __global int *out, int passid @@ -33,7 +36,7 @@ This* this=&thisStruct; this->out = out; this->passid = passid; { -this->out[0] = foo(); +this->out[0] = com_amd_aparapi_test_CallObjectStatic$Dummy__foo(); return; } } diff --git a/test/codegen/src/java/com/amd/aparapi/test/CallStaticInAnotherClass.java b/test/codegen/src/java/com/amd/aparapi/test/CallStaticInAnotherClass.java new file mode 100644 index 00000000..b6fcac03 --- /dev/null +++ b/test/codegen/src/java/com/amd/aparapi/test/CallStaticInAnotherClass.java @@ -0,0 +1,53 @@ +package com.amd.aparapi.test; + +import com.amd.aparapi.Kernel; + + +class AnotherClass{ + static public int foo() { + return 42; + } +}; + +public class CallStaticInAnotherClass extends Kernel{ + + public int doodoo() { + return AnotherClass.foo(); + } + + public void run() { + out[0] = AnotherClass.foo() + doodoo(); + } + + int out[] = new int[2]; +} + +/**{OpenCL{ +typedef struct This_s{ + __global int *out; + int passid; +}This; +int get_pass_id(This *this){ + return this->passid; +} +int com_amd_aparapi_test_AnotherClass__foo(){ + return(42); +} +int com_amd_aparapi_test_CallStaticInAnotherClass__doodoo(This *this){ + return(com_amd_aparapi_test_AnotherClass__foo()); +} +__kernel void run( + __global int *out, + int passid +){ + This thisStruct; + This* this=&thisStruct; + this->out = out; + this->passid = passid; + { + this->out[0] = com_amd_aparapi_test_AnotherClass__foo() + com_amd_aparapi_test_CallStaticInAnotherClass__doodoo(this); + return; + } +} + +}OpenCL}**/ -- GitLab