diff options
| author | Yong He <yonghe@outlook.com> | 2022-08-20 01:03:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-20 01:03:06 -0700 |
| commit | af70651a4843b16dd24e14b5cedffe399ebeb862 (patch) | |
| tree | a6aefd5db94a048114b9a8d7ed3f826533105fab /tests/cpu-program | |
| parent | 6412c4913b6a063438bb11863f2c154d3ae42dfe (diff) | |
Call `gfx` in slang program. (#2370)
Diffstat (limited to 'tests/cpu-program')
| -rw-r--r-- | tests/cpu-program/gfx-smoke.slang | 16 | ||||
| -rw-r--r-- | tests/cpu-program/gfx-smoke.slang.expected | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/cpu-program/gfx-smoke.slang b/tests/cpu-program/gfx-smoke.slang new file mode 100644 index 000000000..e04848f5d --- /dev/null +++ b/tests/cpu-program/gfx-smoke.slang @@ -0,0 +1,16 @@ +//TEST:EXECUTABLE: +__target_intrinsic(cpp, "printf(\"%s\\n\", ($0).getBuffer())") +void writeln(String text); + +import gfx; + +public __extern_cpp int main() +{ + gfx.DeviceDesc deviceDesc = {}; + deviceDesc.deviceType = gfx.DeviceType.CPU; + gfx.IDevice obj; + if (gfx.succeeded(gfx.gfxCreateDevice(&deviceDesc, obj))) + writeln("succ"); + else + writeln("fail"); +}
\ No newline at end of file diff --git a/tests/cpu-program/gfx-smoke.slang.expected b/tests/cpu-program/gfx-smoke.slang.expected new file mode 100644 index 000000000..981dcfc29 --- /dev/null +++ b/tests/cpu-program/gfx-smoke.slang.expected @@ -0,0 +1,6 @@ +result code = 0 +standard error = { +} +standard output = { +succ +} |
