heatd added inline comments.

================
Comment at: clang/test/CodeGenCXX/fcheck-new.cpp:2
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -fcheck-new -triple x86_64-linux-gnu -S -disable-O0-optnone 
\
+// RUN: -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s
----------------
MaskRay wrote:
> In this test, if I remove `-fcheck-new` , nothing will change. So this isn't 
> a good test.
> 
> I think we need something like:
> ```
> struct A { A(); };
> void *test0() { return A; }
> ```
It will change (the attributes of _Znwm).

From the test (with -fcheck-new):
```
[[CALL:%.*]] = call noalias noundef ptr @_Znwm(i64 noundef 4) #[[ATTR2:[0-9]+]]
```
The same test (but without -fcheck-new, tested locally):

```
  %1 = tail call noalias noundef nonnull dereferenceable(4) ptr @_Znwm(i64 
noundef 4) #2
```

As you'll see, the non-fcheck-new has nonnull attached to _Znwm, while 
-fcheck-new doesn't. This is exactly the behavior we want to test for.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125272/new/

https://reviews.llvm.org/D125272

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to