Skip to content

Commit 5871858

Browse files
committed
Merge from 'main' to 'sycl-web' (intel#15)
CONFLICT (content): Merge conflict in clang/test/Preprocessor/sycl-macro.cpp CONFLICT (content): Merge conflict in clang/test/Driver/sycl.c CONFLICT (content): Merge conflict in clang/lib/Frontend/InitPreprocessor.cpp CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Clang.cpp CONFLICT (content): Merge conflict in clang/include/clang/Basic/LangOptions.h CONFLICT (content): Merge conflict in clang/include/clang/Basic/LangOptions.def
2 parents fa2fc21 + 6381664 commit 5871858

File tree

199 files changed

+1080
-1091
lines changed

Some content is hidden

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

199 files changed

+1080
-1091
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4612,7 +4612,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
46124612
SYCLStdArg->render(Args, CmdArgs);
46134613
CmdArgs.push_back("-fsycl-std-layout-kernel-params");
46144614
} else {
4615-
// Ensure the default version in SYCL mode is 2020
4615+
// Ensure the default version in SYCL mode is 2020.
46164616
CmdArgs.push_back("-sycl-std=2020");
46174617
}
46184618
if (Args.hasArg(options::OPT_fsycl_unnamed_lambda))

clang/lib/Frontend/InitPreprocessor.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,8 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
484484
if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2017) {
485485
Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121");
486486
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "201707");
487-
} else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020) {
487+
} else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020)
488488
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001");
489-
}
490489

491490
if (LangOpts.SYCLValueFitInMaxInt)
492491
Builder.defineMacro("__SYCL_ID_QUERIES_FIT_IN_INT__", "1");

clang/test/CodeGenCXX/debug-info-line.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ bar b[1] = { //
146146
(fn(), //
147147
bar())};
148148

149-
// CHECK-LABEL: define
149+
// CHECK-LABEL: define{{.*}}f11
150150
__complex double f11() {
151151
__complex double f;
152152
// CHECK: store {{.*}} !dbg [[DBG_F11:!.*]]

clang/test/Driver/sycl.c

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// RUN: %clang -### -fsycl -sycl-std=1.2.1 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
44
// RUN: %clang -### -fsycl -sycl-std=121 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
55
// RUN: %clang -### -fsycl -sycl-std=2017 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
6+
// RUN: %clang -### -fsycl -sycl-std=2020 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
67
// RUN: %clang -### -fsycl -sycl-std=sycl-1.2.1 %s 2>&1 | FileCheck %s --check-prefix=ENABLED
78
// RUN: %clang -### -fno-sycl -fsycl %s 2>&1 | FileCheck %s --check-prefix=ENABLED
89
// RUN: %clang -### -sycl-std=2017 %s 2>&1 | FileCheck %s --check-prefix=NOT_ENABLED
@@ -109,3 +110,9 @@
109110
// RUN: %clang_cl -### -fsycl-device-only -fno-sycl-id-queries-fit-in-int %s 2>&1 | FileCheck %s --check-prefix=NO_ID_QUERIES
110111
// ID_QUERIES: "-fsycl-id-queries-fit-in-int"
111112
// NO_ID_QUERIES: "-fno-sycl-id-queries-fit-in-int"
113+
114+
// RUN: %clang -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
115+
// RUN: %clangxx -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
116+
// RUN: %clang_cl -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=DEFAULT
117+
118+
// DEFAULT: "-sycl-std=2020"

clang/test/Preprocessor/sycl-macro.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// RUN: %clang_cc1 %s -fsycl-is-device -E -dM | FileCheck --check-prefix=CHECK-SYCL-ID %s
33
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s
44
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2017 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD %s
5+
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -sycl-std=2020 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s
6+
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-host -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s
57
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=2020 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-2020 %s
68
// RUN: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -sycl-std=1.2.1 -E -dM | FileCheck --check-prefix=CHECK-SYCL-STD-DEVICE %s
79
// RUNx: %clang_cc1 %s -fsycl-id-queries-fit-in-int -fsycl-is-device -E -dM -fms-compatibility | FileCheck --check-prefix=CHECK-MSVC %s

libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010

1111
// pop_back() more than the number of elements in a deque
1212

13-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
13+
// UNSUPPORTED: libcxx-no-debug-mode
14+
15+
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
1416

15-
#include <cstdlib>
1617
#include <deque>
1718

1819
#include "test_macros.h"
19-
20+
#include "debug_macros.h"
2021

2122
int main(int, char**) {
2223
std::deque<int> q;
2324
q.push_back(0);
2425
q.pop_back();
25-
q.pop_back();
26-
std::exit(1);
26+
TEST_LIBCPP_ASSERT_FAILURE(q.pop_back(), "deque::pop_back called on an empty deque");
2727

28-
return 0;
28+
return 0;
2929
}

libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,19 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cstdlib>
20-
#include <cassert>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
std::list<int> l1;
2725
l1.push_back(1); l1.push_back(2); l1.push_back(3);
2826
std::list<int>::iterator i = l1.begin();
2927
std::list<int> l2 = l1;
30-
l2.erase(i);
31-
assert(false);
28+
TEST_LIBCPP_ASSERT_FAILURE(l2.erase(i), "list::erase(iterator) called with an iterator not referring to this list");
3229

33-
return 0;
30+
return 0;
3431
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp

+9-19
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,25 @@
1414
// UNSUPPORTED: libcxx-no-debug-mode
1515

1616
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
17-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1817

1918
#include <list>
20-
#include <cstdlib>
21-
#include <cassert>
2219

2320
#include "test_macros.h"
21+
#include "debug_macros.h"
2422

25-
class A
26-
{
27-
int i_;
28-
double d_;
29-
30-
A(const A&);
31-
A& operator=(const A&);
32-
public:
33-
A(int i, double d)
34-
: i_(i), d_(d) {}
35-
36-
int geti() const {return i_;}
37-
double getd() const {return d_;}
23+
struct A {
24+
explicit A(int i, double d) {
25+
(void)i;
26+
(void)d;
27+
}
3828
};
3929

4030
int main(int, char**)
4131
{
4232
std::list<A> c1;
4333
std::list<A> c2;
44-
std::list<A>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
45-
assert(false);
34+
TEST_LIBCPP_ASSERT_FAILURE(c1.emplace(c2.cbegin(), 2, 3.5),
35+
"list::emplace(iterator, args...) called with an iterator not referring to this list");
4636

47-
return 0;
37+
return 0;
4838
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,18 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cassert>
20-
#include <cstdlib>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
int a1[] = {1, 2, 3};
2725
std::list<int> l1(a1, a1+3);
2826
std::list<int>::const_iterator i = l1.end();
29-
l1.erase(i);
30-
assert(false);
27+
TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "list::erase(iterator) called with a non-dereferenceable iterator");
3128

32-
return 0;
29+
return 0;
3330
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,19 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cassert>
20-
#include <cstdlib>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
int a1[] = {1, 2, 3};
2725
std::list<int> l1(a1, a1+3);
2826
std::list<int> l2(a1, a1+3);
2927
std::list<int>::const_iterator i = l2.begin();
30-
l1.erase(i);
31-
assert(false);
28+
TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "list::erase(iterator) called with an iterator not referring to this list");
3229

33-
return 0;
30+
return 0;
3431
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cassert>
20-
#include <cstdlib>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
int a1[] = {1, 2, 3};
2725
std::list<int> l1(a1, a1+3);
2826
std::list<int> l2(a1, a1+3);
29-
std::list<int>::iterator i = l1.erase(l2.cbegin(), next(l1.cbegin()));
30-
assert(false);
27+
TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), std::next(l1.cbegin())),
28+
"list::erase(iterator, iterator) called with an iterator not referring to this list");
3129

32-
return 0;
30+
return 0;
3331
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cassert>
20-
#include <cstdlib>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
int a1[] = {1, 2, 3};
2725
std::list<int> l1(a1, a1+3);
2826
std::list<int> l2(a1, a1+3);
29-
std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
30-
assert(false);
27+
TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin(), std::next(l2.cbegin())),
28+
"list::erase(iterator, iterator) called with an iterator not referring to this list");
3129

32-
return 0;
30+
return 0;
3331
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cassert>
20-
#include <cstdlib>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
int a1[] = {1, 2, 3};
2725
std::list<int> l1(a1, a1+3);
2826
std::list<int> l2(a1, a1+3);
29-
std::list<int>::iterator i = l1.erase(l2.cbegin(), next(l2.cbegin()));
30-
assert(false);
27+
TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), std::next(l2.cbegin())),
28+
"list::erase(iterator, iterator) called with an iterator not referring to this list");
3129

32-
return 0;
30+
return 0;
3331
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cassert>
20-
#include <cstdlib>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
int a1[] = {1, 2, 3};
2725
std::list<int> l1(a1, a1+3);
28-
std::list<int>::iterator i = l1.erase(next(l1.cbegin()), l1.cbegin());
29-
assert(false);
26+
TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
27+
"Attempted to increment a non-incrementable list::const_iterator");
3028

31-
return 0;
29+
return 0;
3230
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,20 @@
1414
// UNSUPPORTED: libcxx-no-debug-mode
1515

1616
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
17-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1817

1918
#include <list>
20-
#include <cstdlib>
21-
#include <cassert>
19+
2220
#include "test_macros.h"
23-
#include "test_iterators.h"
21+
#include "debug_macros.h"
2422

2523
int main(int, char**)
2624
{
2725
{
2826
std::list<int> v(100);
2927
std::list<int> v2(100);
3028
int a[] = {1, 2, 3, 4, 5};
31-
const int N = sizeof(a)/sizeof(a[0]);
32-
std::list<int>::iterator i = v.insert(next(v2.cbegin(), 10),
33-
cpp17_input_iterator<const int*>(a),
34-
cpp17_input_iterator<const int*>(a+N));
35-
assert(false);
29+
TEST_LIBCPP_ASSERT_FAILURE(v.insert(v2.cbegin(), a, a + 5),
30+
"list::insert(iterator, range) called with an iterator not referring to this list");
3631
}
3732

3833
return 0;

libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cstdlib>
20-
#include <cassert>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
std::list<int> v1(3);
2725
std::list<int> v2(3);
28-
v1.insert(v2.begin(), 4);
29-
assert(false);
26+
TEST_LIBCPP_ASSERT_FAILURE(v1.insert(v2.begin(), 4),
27+
"list::insert(iterator, x) called with an iterator not referring to this list");
3028

31-
return 0;
29+
return 0;
3230
}

libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@
1313
// UNSUPPORTED: libcxx-no-debug-mode
1414

1515
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
16-
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
1716

1817
#include <list>
19-
#include <cstdlib>
20-
#include <cassert>
2118

2219
#include "test_macros.h"
20+
#include "debug_macros.h"
2321

2422
int main(int, char**)
2523
{
2624
std::list<int> c1(100);
2725
std::list<int> c2;
28-
std::list<int>::iterator i = c1.insert(next(c2.cbegin(), 10), 5, 1);
29-
assert(false);
26+
TEST_LIBCPP_ASSERT_FAILURE(c1.insert(c2.cbegin(), 5, 1),
27+
"list::insert(iterator, n, x) called with an iterator not referring to this list");
3028

31-
return 0;
29+
return 0;
3230
}

0 commit comments

Comments
 (0)