[PATCH] D137942: [CGObjC] Add run line for release mode in test arc-exceptions-seh.mm (NFC)

Stefan Gränitz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 14 06:09:51 PST 2022


sgraenitz created this revision.
Herald added a project: All.
sgraenitz requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In release mode the updated `arc-exceptions-seh.mm` test fails and needs `-enable-objc-arc-opts=false` to skip ObjC ARC optimizations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137942

Files:
  clang/test/CodeGenObjCXX/arc-exceptions-seh.mm


Index: clang/test/CodeGenObjCXX/arc-exceptions-seh.mm
===================================================================
--- clang/test/CodeGenObjCXX/arc-exceptions-seh.mm
+++ clang/test/CodeGenObjCXX/arc-exceptions-seh.mm
@@ -1,11 +1,12 @@
-// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -emit-llvm -fobjc-arc -fexceptions -fobjc-exceptions -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -O0 -triple x86_64-pc-windows-msvc -emit-llvm -fobjc-arc -fexceptions -fobjc-exceptions -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-O0
+// RUN: %clang_cc1 -O2 -triple x86_64-pc-windows-msvc -emit-llvm -fobjc-arc -fexceptions -fobjc-exceptions -fobjc-runtime=gnustep-2.0 -mllvm -enable-objc-arc-opts=false -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-O2
 
 // WinEH requires funclet tokens on nounwind intrinsics if they can lower to
 // regular function calls in the course of IR transformations.
 //
 // This is the case for ObjC ARC runtime intrinsics. Test that clang emits the
-// funclet tokens for llvm.objc.retain and llvm.objc.storeStrong and that they
-// refer to their catchpad's SSA value.
+// funclet tokens for llvm.objc.* calls inside catchpads and that they refer to
+// their catchpad's SSA value.
 
 void do_something();
 void may_throw(id);
@@ -39,10 +40,12 @@
 // CHECK:           may_throw
 // CHECK:           [ "funclet"(token [[CATCHPAD]]) ]
 // CHECK:           call
-// CHECK:           @llvm.objc.storeStrong
+// CHECK-O0:        @llvm.objc.storeStrong
+// CHECK-O2:        @llvm.objc.release
 // CHECK:           [ "funclet"(token [[CATCHPAD]]) ]
-// CHECK:           catchret from [[CATCHPAD]] to label %catchret.dest
+// CHECK-O0:        catchret from [[CATCHPAD]] to label %catchret.dest
+// CHECK-O2:        catchret from [[CATCHPAD]] to label %eh.cont
 //
-// This block exists and it's empty:
-// CHECK:         catchret.dest:
-// CHECK-NEXT:      br label %eh.cont
+// In debug mode, this block exists and it's empty:
+// CHECK-O0:      catchret.dest:
+// CHECK-O0-NEXT:   br label %eh.cont


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137942.475127.patch
Type: text/x-patch
Size: 2084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221114/4dd8b383/attachment.bin>


More information about the cfe-commits mailing list