Skip to content

Commit ae71a8f

Browse files
authored
[SYCLomatic #546] Add overload resolution test case (#220)
* [SYCLomatic #546] Add overload resolution test case Signed-off-by: Michael Aziz <[email protected]> * [SYCLomatic] Add test cases Signed-off-by: Michael Aziz <[email protected]> --------- Signed-off-by: Michael Aziz <[email protected]>
1 parent 19baeb9 commit ae71a8f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// ====------ result_type_overload.cu---------- *- CUDA -* ----===////
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//
8+
// ===----------------------------------------------------------------------===//
9+
10+
#include <cstdio>
11+
#include <cstdlib>
12+
13+
#include <cuda.h>
14+
#include <cudnn.h>
15+
16+
int printResult(cudaError_t x) {
17+
printf("cudaError = %i\n", x);
18+
return 5;
19+
}
20+
21+
int printResult(cudnnStatus_t x) {
22+
printf("cudnnStatus = %i\n", x);
23+
return 10;
24+
}
25+
26+
int main() {
27+
float *d_x;
28+
cudnnHandle_t handle;
29+
30+
cudaError_t r0;
31+
const cudaError_t r1 = cudaMalloc(&d_x, 5 * sizeof(*d_x));
32+
const cudnnStatus_t r2 = cudnnCreate(&handle);
33+
const int r3 = r1;
34+
const bool a1 = printResult(r1) == 5;
35+
const bool a2 = printResult(r2) == 10;
36+
return (a1 && a2 ? EXIT_SUCCESS : EXIT_FAILURE);
37+
}

features/features.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@
389389
<test testName="test_shared_memory" configFile="config/TEMPLATE_memory.xml" />
390390
<test testName="activemask" configFile="config/TEMPLATE_misc_excluding_80.xml" />
391391
<test testName="merge1004to1007" configFile="config/TEMPLATE_misc.xml" />
392+
<test testName="result_type_overload" configFile="config/TEMPLATE_misc.xml" />
392393
<test testName="user_defined_rules" configFile="config/TEMPLATE_user_defined_rules.xml" />
393394
<test testName="get_library_version" configFile="config/TEMPLATE_misc.xml" />
394395
<test testName="LibCommonUtils_api_test1" configFile="config/TEMPLATE_custom_helper_files_LibCommonUtils.xml" />

0 commit comments

Comments
 (0)