Skip to content

Commit 1261155

Browse files
Merge branch 'main' into upstream-npm-seeking-support
2 parents ee4a573 + 54f69ca commit 1261155

Some content is hidden

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

51 files changed

+4230
-616
lines changed

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6644,6 +6644,7 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType,
66446644

66456645
if (auto *CalleeDecl = dyn_cast_or_null<FunctionDecl>(TargetDecl)) {
66466646
if (CalleeDecl->hasAttr<RestrictAttr>() ||
6647+
CalleeDecl->hasAttr<MallocSpanAttr>() ||
66476648
CalleeDecl->hasAttr<AllocSizeAttr>()) {
66486649
// Function has 'malloc' (aka. 'restrict') or 'alloc_size' attribute.
66496650
if (SanOpts.has(SanitizerKind::AllocToken)) {

clang/test/CodeGenCXX/alloc-token.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ struct __sized_ptr_t {
1717
size_t n;
1818
};
1919
enum class __hot_cold_t : uint8_t;
20-
__sized_ptr_t __size_returning_new(size_t size);
21-
__sized_ptr_t __size_returning_new_hot_cold(size_t, __hot_cold_t);
22-
__sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t);
23-
__sized_ptr_t __size_returning_new_aligned_hot_cold(size_t, std::align_val_t, __hot_cold_t);
20+
__sized_ptr_t __size_returning_new(size_t size) __attribute__((malloc_span));
21+
__sized_ptr_t __size_returning_new_hot_cold(size_t, __hot_cold_t) __attribute__((malloc_span));
22+
__sized_ptr_t __size_returning_new_aligned(size_t, std::align_val_t) __attribute__((malloc_span));
23+
__sized_ptr_t __size_returning_new_aligned_hot_cold(size_t, std::align_val_t, __hot_cold_t) __attribute__((malloc_span));
2424
}
2525

2626
void *sink; // prevent optimizations from removing the calls
@@ -101,12 +101,11 @@ int *test_new_array_nothrow() {
101101
}
102102

103103
// CHECK-LABEL: define dso_local void @_Z23test_size_returning_newv(
104-
// CHECK: call { ptr, i64 } @__size_returning_new(i64 noundef 8)
105-
// CHECK: call { ptr, i64 } @__size_returning_new_hot_cold(i64 noundef 8, i8 noundef zeroext 1)
106-
// CHECK: call { ptr, i64 } @__size_returning_new_aligned(i64 noundef 8, i64 noundef 32)
107-
// CHECK: call { ptr, i64 } @__size_returning_new_aligned_hot_cold(i64 noundef 8, i64 noundef 32, i8 noundef zeroext 1)
104+
// CHECK: call { ptr, i64 } @__size_returning_new(i64 noundef 8){{.*}} !alloc_token [[META_LONG]]
105+
// CHECK: call { ptr, i64 } @__size_returning_new_hot_cold(i64 noundef 8, i8 noundef zeroext 1){{.*}} !alloc_token [[META_LONG]]
106+
// CHECK: call { ptr, i64 } @__size_returning_new_aligned(i64 noundef 8, i64 noundef 32){{.*}} !alloc_token [[META_LONG]]
107+
// CHECK: call { ptr, i64 } @__size_returning_new_aligned_hot_cold(i64 noundef 8, i64 noundef 32, i8 noundef zeroext 1){{.*}}_token [[META_LONG]]
108108
void test_size_returning_new() {
109-
// FIXME: Support __size_returning_new variants.
110109
sink = __size_returning_new(sizeof(long)).p;
111110
sink = __size_returning_new_hot_cold(sizeof(long), __hot_cold_t{1}).p;
112111
sink = __size_returning_new_aligned(sizeof(long), std::align_val_t{32}).p;

flang/test/Lower/Intrinsics/command_argument_count.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
! RUN: bbc -emit-fir %s -o - | FileCheck %s
22
! bbc doesn't have a way to set the default kinds so we use flang driver
3-
! RUN: flang -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s
3+
! RUN: %flang_fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s
44

55
! CHECK-LABEL: argument_count_test
66
subroutine argument_count_test()

flang/test/Lower/Intrinsics/modulo.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! RUN: bbc -emit-fir -hlfir=false %s -o - | FileCheck %s -check-prefixes=HONORINF,ALL
2-
! RUN: flang -fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL,%if flang-supports-f128-math %{F128%} %else %{F64%}
2+
! RUN: %flang_fc1 -menable-no-infs -emit-fir -flang-deprecated-no-hlfir %s -o - | FileCheck %s -check-prefixes=CHECK,ALL,%if flang-supports-f128-math %{F128%} %else %{F64%}
33

44
! ALL-LABEL: func @_QPmodulo_testr(
55
! ALL-SAME: %[[arg0:.*]]: !fir.ref<f64>{{.*}}, %[[arg1:.*]]: !fir.ref<f64>{{.*}}, %[[arg2:.*]]: !fir.ref<f64>{{.*}}) {

flang/test/Lower/OpenMP/Todo/omp-clause-indirect.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
! This test checks the lowering of OpenMP Indirect Clause when used with the Declare Target directive
22

3-
! RUN: not flang -fc1 -emit-fir -fopenmp -fopenmp-version=52 %s 2>&1 | FileCheck %s
3+
! RUN: not %flang_fc1 -emit-fir -fopenmp -fopenmp-version=52 %s 2>&1 | FileCheck %s
44

55
module functions
66
implicit none

flang/test/Lower/OpenMP/Todo/omp-declarative-allocate.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
! This test checks lowering of OpenMP allocate Directive.
22

3-
! RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
3+
! RUN: not %flang_fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
44

55
program main
66
integer :: x, y

flang/test/Lower/OpenMP/Todo/omp-declare-reduction-initsub.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
! This test checks lowering of OpenMP declare reduction Directive, with initialization
22
! via a subroutine. This functionality is currently not implemented.
33

4-
! RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
4+
! RUN: not %flang_fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
55

66
!CHECK: not yet implemented: OpenMPDeclareReductionConstruct
77
subroutine initme(x,n)

flang/test/Lower/OpenMP/Todo/omp-declare-reduction.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
! This test checks lowering of OpenMP declare reduction Directive.
22

3-
! RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
3+
! RUN: not %flang_fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
44

55
subroutine declare_red()
66
integer :: my_var

flang/test/Lower/OpenMP/Todo/omp-declare-simd.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
! This test checks lowering of OpenMP declare simd Directive.
22

3-
// RUN: not flang -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
3+
// RUN: not %flang_fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s
44

55
subroutine sub(x, y)
66
real, intent(inout) :: x, y

flang/test/Lower/OpenMP/cray-pointers01.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! Test lowering of Cray pointee references.
2-
! RUN: flang -fc1 -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s
2+
! RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s
33

44
module test_host_assoc_cray_pointer
55
! CHECK-LABEL: fir.global @_QMtest_host_assoc_cray_pointerEivar : i64

0 commit comments

Comments
 (0)