Sirraide wrote:
> I still see `CodeGen/attr-counted-by*.c` being unnecessarily changed.
Yeah, the `-O2` definitely needs to be added back to those tests.
https://github.com/llvm/llvm-project/pull/114495
___
cfe-commits mailing list
cfe-commits@lists.l
@@ -13,7 +13,10 @@ void init(void *
__attribute__((pass_dynamic_object_size(0;
// CHECK-LABEL: define dso_local void @_ZN3foo3barC1Ev(
// CHECK-SAME: ptr noundef nonnull align 4 dereferenceable(1) [[THIS:%.*]])
unnamed_addr #[[ATTR0:[0-9]+]] align 2 {
// CHECK-NEXT: entr
@@ -13,7 +13,10 @@ void init(void *
__attribute__((pass_dynamic_object_size(0;
// CHECK-LABEL: define dso_local void @_ZN3foo3barC1Ev(
// CHECK-SAME: ptr noundef nonnull align 4 dereferenceable(1) [[THIS:%.*]])
unnamed_addr #[[ATTR0:[0-9]+]] align 2 {
// CHECK-NEXT: entr
@@ -13,7 +13,10 @@ void init(void *
__attribute__((pass_dynamic_object_size(0;
// CHECK-LABEL: define dso_local void @_ZN3foo3barC1Ev(
// CHECK-SAME: ptr noundef nonnull align 4 dereferenceable(1) [[THIS:%.*]])
unnamed_addr #[[ATTR0:[0-9]+]] align 2 {
// CHECK-NEXT: entr
@@ -13,7 +13,10 @@ void init(void *
__attribute__((pass_dynamic_object_size(0;
// CHECK-LABEL: define dso_local void @_ZN3foo3barC1Ev(
// CHECK-SAME: ptr noundef nonnull align 4 dereferenceable(1) [[THIS:%.*]])
unnamed_addr #[[ATTR0:[0-9]+]] align 2 {
// CHECK-NEXT: entr
@@ -13,7 +13,10 @@ void init(void *
__attribute__((pass_dynamic_object_size(0;
// CHECK-LABEL: define dso_local void @_ZN3foo3barC1Ev(
// CHECK-SAME: ptr noundef nonnull align 4 dereferenceable(1) [[THIS:%.*]])
unnamed_addr #[[ATTR0:[0-9]+]] align 2 {
// CHECK-NEXT: entr
@@ -13,7 +13,10 @@ void init(void *
__attribute__((pass_dynamic_object_size(0;
// CHECK-LABEL: define dso_local void @_ZN3foo3barC1Ev(
// CHECK-SAME: ptr noundef nonnull align 4 dereferenceable(1) [[THIS:%.*]])
unnamed_addr #[[ATTR0:[0-9]+]] align 2 {
// CHECK-NEXT: entr
@@ -16,6 +16,8 @@ void test1(struct fam_struct *ptr, int size, int idx) {
*__builtin_counted_by_ref(ptr->array) = size; // ok
*__builtin_counted_by_ref(&ptr->array[idx]) = size; // ok
+ *__builtin_counted_by_ref(&ptr->array) = size;// ok
@@ -4914,3 +4914,9 @@ def ArithmeticFence : LangBuiltin<"ALL_LANGUAGES"> {
let Attributes = [CustomTypeChecking, Constexpr];
let Prototype = "void(...)";
}
+
+def CountedByRef : Builtin {
+ let Spellings = ["__builtin_counted_by_ref"];
+ let Attributes = [NoThrow, CustomT
@@ -16,6 +16,8 @@ void test1(struct fam_struct *ptr, int size, int idx) {
*__builtin_counted_by_ref(ptr->array) = size; // ok
*__builtin_counted_by_ref(&ptr->array[idx]) = size; // ok
+ *__builtin_counted_by_ref(&ptr->array) = size;// ok
@@ -16,6 +16,8 @@ void test1(struct fam_struct *ptr, int size, int idx) {
*__builtin_counted_by_ref(ptr->array) = size; // ok
*__builtin_counted_by_ref(&ptr->array[idx]) = size; // ok
+ *__builtin_counted_by_ref(&ptr->array) = size;// ok
@@ -0,0 +1,182 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O2 -emit-llvm -o - %s |
FileCheck %s --check-prefix=X86_64
+// RUN: %clang_cc1 -triple i386-unknown-unknown
@@ -0,0 +1,182 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 5
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O2 -emit-llvm -o - %s |
FileCheck %s --check-prefix=X86_64
+// RUN: %clang_cc1 -triple i386-unknown-unknown
bwendling wrote:
-ast-print testcase added.
https://github.com/llvm/llvm-project/pull/114495
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AaronBallman commented:
Can you add a test with `-ast-print` that shows we print out the builtin as
it's used in the source, and a test with `-ast-dump` that shows the AST retains
information about the use of the builtin?
https://github.com/llvm/llvm-project/pull/114495
bwendling wrote:
@AaronBallman @rapidsna -- I think I covered all of the comments you made on
the other PR (stupid git!). PTAL.
https://github.com/llvm/llvm-project/pull/114495
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 51a4f319f022b99f231e52fab97de28b6f1db591
a5245e5d6e026f389e64245a8ce4df643abec4a5 --e
bwendling wrote:
This is a new PR, because GitHub messed up. Here's the original:
https://github.com/llvm/llvm-project/pull/102549
https://github.com/llvm/llvm-project/pull/114495
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.l
18 matches
Mail list logo