Skip to content

Commit dc14cd0

Browse files
authored
[Comgr] Add test for get_version() API
1 parent fb62823 commit dc14cd0

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

amd/comgr/test-lit/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ add_comgr_lit_binary(spirv-translator c)
4343
add_comgr_lit_binary(compile-opencl-minimal c)
4444
add_comgr_lit_binary(spirv-to-reloc c)
4545
add_comgr_lit_binary(unbundle c)
46+
add_comgr_lit_binary(get-version c)
4647
add_comgr_lit_binary(status-string c)
4748
add_comgr_lit_binary(data-action c)
4849

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//===- get-version.c ------------------------------------------------------===//
2+
//
3+
// Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See
4+
// amd/comgr/LICENSE.TXT in this repository for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "amd_comgr.h"
10+
#include "common.h"
11+
12+
int main(int argc, char *argv[]) {
13+
14+
size_t *Major = malloc(sizeof(size_t));
15+
size_t *Minor = malloc(sizeof(size_t));
16+
17+
amd_comgr_get_version(Major, Minor);
18+
19+
if (*Major != 3 || *Minor != 0)
20+
fail("incorrect version: expected 3.0, saw %d, %d", *Major, *Minor);
21+
22+
free(Major);
23+
free(Minor);
24+
return 0;
25+
}

amd/comgr/test-lit/get-version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// COM: Test Comgr get_version() API
2+
// RUN: get-version

0 commit comments

Comments
 (0)