[PATCH] D137941: [clang] NFC: Robustify test regex

Nathan Sidwell via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 21 11:20:54 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGeff9d72b9b63: [clang] NFC: Robustify sret test regex (authored by urnathan).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137941

Files:
  clang/test/CodeGen/sret.c
  clang/test/CodeGen/sret2.c


Index: clang/test/CodeGen/sret2.c
===================================================================
--- clang/test/CodeGen/sret2.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | grep sret | grep -v 'sret2.c' | count 1
-
-struct abc {
- long a;
- long b;
- long c;
- long d;
- long e;
-};
- 
-struct abc foo2(void){}
Index: clang/test/CodeGen/sret.c
===================================================================
--- clang/test/CodeGen/sret.c
+++ clang/test/CodeGen/sret.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -Wno-strict-prototypes -emit-llvm -o - | grep sret | grep -v 'sret.c' | count 4
+// RUN: %clang_cc1 %s -Wno-strict-prototypes -emit-llvm -o - | FileCheck %s
 
 struct abc {
  long a;
@@ -7,11 +7,17 @@
  long d;
  long e;
 };
- 
+
 struct abc foo1(void);
+// CHECK-DAG: declare {{.*}} @foo1(ptr sret(%struct.abc)
 struct abc foo2();
+// CHECK-DAG: declare {{.*}} @foo2(ptr sret(%struct.abc)
+struct abc foo3(void){}
+// CHECK-DAG: define {{.*}} @foo3(ptr noalias sret(%struct.abc)
 
 void bar(void) {
   struct abc dummy1 = foo1();
+  // CHECK-DAG: call {{.*}} @foo1(ptr sret(%struct.abc)
   struct abc dummy2 = foo2();
+  // CHECK-DAG: call {{.*}} @foo2(ptr sret(%struct.abc)
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137941.476958.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221121/8adb573e/attachment.bin>


More information about the cfe-commits mailing list