[PATCH] D125272: [clang] Add -fcheck-new support

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 26 18:49:27 PDT 2023


MaskRay 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
----------------
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; }
```


================
Comment at: clang/test/CodeGenCXX/fcheck-new.cpp:3
+// 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
+
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125272



More information about the cfe-commits mailing list