Skip to content

Commit 23049c4

Browse files
committed
Merge branch 'sycl' into review/yang/restructure_asan_msan
2 parents 5f77720 + 1873789 commit 23049c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+148
-67
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6969,6 +6969,7 @@ bool SYCLIntegrationFooter::emit(raw_ostream &OS) {
69696969
Policy.adjustForCPlusPlusFwdDecl();
69706970
Policy.SuppressTypedefs = true;
69716971
Policy.SuppressUnwrittenScope = true;
6972+
Policy.PrintCanonicalTypes = true;
69726973

69736974
llvm::SmallSet<const VarDecl *, 8> Visited;
69746975
bool EmittedFirstSpecConstant = false;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// RUN: %clang_cc1 -fsycl-is-device -internal-isystem %S/Inputs -triple spir64-unknown-unknown -fsycl-int-footer=%t.footer.h -emit-llvm %s -o -
2+
// RUN: FileCheck -input-file=%t.footer.h %s --check-prefix=CHECK-FOOTER
3+
4+
// This test checks that integration footer is emitted correctly when a
5+
// device_global has an explicit template specialization in template arguments.
6+
7+
#include "sycl.hpp"
8+
9+
namespace sycl {
10+
template <typename T> struct X {};
11+
template <> struct X<int> {};
12+
namespace detail {
13+
struct Y {};
14+
} // namespace detail
15+
template <> struct X<detail::Y> {};
16+
} // namespace sycl
17+
18+
using namespace sycl;
19+
template <typename T, typename = X<detail::Y>> struct Arg1 { T val; };
20+
21+
using namespace sycl::ext::oneapi;
22+
template <typename properties_t>
23+
device_global<properties_t> dev_global;
24+
25+
SYCL_EXTERNAL auto foo() {
26+
(void)dev_global<Arg1<int>>;
27+
}
28+
29+
// CHECK-FOOTER: __sycl_device_global_registration::__sycl_device_global_registration() noexcept {
30+
// CHECK-FOOTER-NEXT: device_global_map::add((void *)&::dev_global<Arg1<int, sycl::X<sycl::detail::Y>>>, "_Z10dev_globalI4Arg1IiN4sycl1XINS1_6detail1YEEEEE");
31+
// CHECK-FOOTER-NEXT: }
32+
// CHECK-FOOTER-NEXT: } // namespace (unnamed)

sycl/test-e2e/AddressSanitizer/bad-free/bad-free-host.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t
33
// RUN: %force_device_asan_rt %{run} not %t 2>&1 | FileCheck %s
44
#include <sycl/usm.hpp>

sycl/test-e2e/AddressSanitizer/bad-free/bad-free-minus1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
33
// RUN: %force_device_asan_rt %{run} not %t1.out 2>&1 | FileCheck --check-prefixes CHECK,CHECK-DEVICE %s
44
// RUN: %{build} %device_asan_flags -DMALLOC_HOST -O0 -g -o %t2.out

sycl/test-e2e/AddressSanitizer/bad-free/bad-free-plus1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
33
// RUN: %force_device_asan_rt %{run} not %t1.out 2>&1 | FileCheck --check-prefixes CHECK,CHECK-DEVICE %s
44
// RUN: %{build} %device_asan_flags -DMALLOC_HOST -O0 -g -o %t2.out

sycl/test-e2e/AddressSanitizer/common/demangle-kernel-name.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O2 -g -o %t
33
// RUN: %{run} not %t &> %t.txt ; FileCheck --input-file %t.txt %s
44
#include <sycl/detail/core.hpp>

sycl/test-e2e/AddressSanitizer/common/kernel-debug.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-debug.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O2 -g -o %t
3-
// RUN: env UR_LAYER_ASAN_OPTIONS=debug:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-DEBUG %s
43
// RUN: env UR_LAYER_ASAN_OPTIONS=debug:0 %{run} %t 2>&1 | FileCheck %s
54

65
#include <sycl/usm.hpp>
@@ -23,7 +22,6 @@ int main() {
2322
});
2423
});
2524
Q.wait();
26-
// CHECK-DEBUG: [kernel]
2725
// CHECK-NOT: [kernel]
2826

2927
sycl::free(array, Q);

sycl/test-e2e/AddressSanitizer/common/options-invalid.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-invalid-values.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O0 -g -o %t
33
// RUN: %{run} %t
44

5+
// clang-format off
56
// Invalid ur option format
67
// RUN: env UR_LAYER_ASAN_OPTIONS=a:1,b:1 %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-FORMAT
78
// INVALID-FORMAT: <SANITIZER>[ERROR]: Wrong format of the UR_LAYER_ASAN_OPTIONS environment variable value
@@ -20,8 +21,7 @@
2021
// INVALID-REDZONE: <SANITIZER>[ERROR]: "redzone" should be an integer in range[0, 16].
2122
// RUN: env UR_LAYER_ASAN_OPTIONS=max_redzone:abc %{run} not %t 2>&1 | FileCheck %s --check-prefixes INVALID-MAXREDZONE
2223
// INVALID-MAXREDZONE: <SANITIZER>[ERROR]: "max_redzone" should be an integer in range[0, 2048].
23-
24-
24+
// clang-format on
2525

2626
#include <sycl/usm.hpp>
2727

sycl/test-e2e/AddressSanitizer/common/option-redzone-size.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-redzone.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -DUNSAFE -O0 -g -o %t1.out
33
// RUN: env UR_LAYER_ASAN_OPTIONS=redzone:64 %{run} not %t1.out 2>&1 | FileCheck %s
44
// RUN: %{build} %device_asan_flags -DSAFE -O0 -g -o %t2.out
5+
6+
// clang-format off
57
// RUN: env UR_LOG_SANITIZER=level:debug UR_LAYER_ASAN_OPTIONS=redzone:8 %{run} %t2.out 2>&1 | FileCheck --check-prefixes CHECK-MIN %s
68
// RUN: env UR_LOG_SANITIZER=level:debug UR_LAYER_ASAN_OPTIONS=max_redzone:4096 %{run} %t2.out 2>&1 | FileCheck --check-prefixes CHECK-MAX %s
9+
// clang-format on
710

811
#include <sycl/usm.hpp>
912

@@ -21,7 +24,7 @@ int main() {
2124
}).wait();
2225
// CHECK: ERROR: DeviceSanitizer: out-of-bounds-access on Device USM
2326
// CHECK: {{READ of size 1 at kernel <.*Test> LID\(0, 0, 0\) GID\(0, 0, 0\)}}
24-
// CHECK: {{ #0 .* .*option-redzone-size.cpp:}}[[@LINE-7]]
27+
// CHECK: {{ #0 .* .*options-redzone.cpp:}}[[@LINE-7]]
2528
// CHECK-MIN: Trying to set redzone size to a value less than 16 is ignored
2629
// CHECK-MAX: Trying to set max redzone size to a value greater than 2048 is ignored
2730

sycl/test-e2e/AddressSanitizer/common/statistics.cpp renamed to sycl/test-e2e/AddressSanitizer/common/options-statistics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: linux
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
22
// RUN: %{build} %device_asan_flags -O2 -g -o %t
33
// RUN: %{run} %t 2>&1 | FileCheck %s
44
// RUN: env UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s

0 commit comments

Comments
 (0)