[PATCH] D158231: [clang][test] Fix clang machine-function-split tests

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 17 16:40:47 PDT 2023


MaskRay added inline comments.


================
Comment at: clang/test/CodeGen/fsplit-machine-functions.c:41
+
+// RUN: %clang -c -target arm-unknown-linux-gnueabi -fsplit-machine-functions %s \
+// RUN:     2>&1 | FileCheck -check-prefix=MFS5 %s
----------------
`-target ` has been deprecated since Clang 3.4. Use `--target=`


The warning test should be moved to `Driver/`.
Whenever a warning can be placed either in Driver or in Frontend, we prefer Driver.


================
Comment at: clang/test/Driver/fsplit-machine-functions.c:7
 
-// CHECK-OPT:       "-fsplit-machine-functions"
-// CHECK-NOOPT-NOT: "-fsplit-machine-functions"
-// CHECK-TRIPLE:    warning: -fsplit-machine-functions is not valid for arm
+// CHECK-OPT1:       "-fsplit-machine-functions"
+// CHECK-OPT2:       "-fsplit-machine-functions"
----------------
if OPT1 is identical OPT2, we should use the same prefix.

If you want to test `-fprofile-use=`, test the extra CC1 option from the driver `-fprofile-use=`.


================
Comment at: llvm/test/CodeGen/Generic/machine-function-splitter.ll:19
 ; MFS_ON: Machine Function Splitter Transformation
-; MFS_ON_NO: warning: -fsplit-machine-functions is not valid for
+; MFS_ON-NOT: warning: -fsplit-machine-functions is not valid for
 ;; Check that MFS is not on for non-X86 targets.
----------------
It's usually better to test that there is no warning at all, instead of just testing that there is no one specific warning.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158231



More information about the cfe-commits mailing list