8000 [SYCLomatic #1465] Add test to check the rewording of DPCT1026 (#560) · oneapi-src/SYCLomatic-test@4d04df9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4d04df9

Browse files
author
Yihan Wang
authored
[SYCLomatic #1465] Add test to check the rewording of DPCT1026 (#560)
Signed-off-by: Wang, Yihan <yihan.wang@intel.com>
1 parent fd36f8f commit 4d04df9

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

behavior_tests/behavior_tests.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
<test testName="bt-modified-yaml" configFile="config/TEMPLATE_behavior_tests.xml" />
134134
<test testName="bt-check-warning1083" configFile="config/TEMPLATE_behavior_tests.xml" />
135135
<test testName="bt-check-warning1118" configFile="config/TEMPLATE_behavior_tests.xml" />
136+
<test testName="bt-check-warning1026" configFile="config/TEMPLATE_behavior_tests.xml" />
136137
<test testName="bt-unsupported-type-function" configFile="config/TEMPLATE_behavior_tests_after_9.2.xml" />
137138
<test testName="change-filename-extension" configFile="config/TEMPLATE_behavior_tests.xml" />
138139
<test testName="helper_function_preference_no_queue_device" configFile="config/TEMPLATE_behavior_tests.xml" />
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ===------- do_test.py ---------------------------------- *- Python -* ----===#
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+
import subprocess
11+
import platform
12+
import os
13+
import sys
14+
15+
from test_utils import *
16+
17+
def setup_test():
18+
change_dir(test_config.current_test)
19+
return True
20+
21+
def migrate_test():
22+
call_subprocess(test_config.CT_TOOL + " test.cu --format-range=none --out-root=out --cuda-include-path=" + test_config.include_path)
23+
ret = ""
24+
with open(os.path.join("out", "test.dp.cpp"), 'r') as f:
25+
ret = f.read()
26+
if not is_sub_string("DPCT1026:0: The call to cuInit was removed because this functionality is redundant in SYCL.", ret):
27+
return False
28+
change_dir("out")
29+
return True
30+
31+
def build_test():
32+
src_files = ["test.dp.cpp"]
33+
return compile_files(src_files)
34+
35+
def run_test():
36+
return True
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// ===------- test.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 <cuda.h>
11+
12+
void test_1() {
13+
cuInit(0);
14+
}

0 commit comments

Comments
 (0)
0