Nathan Sidwell eff9d72b9b [clang] NFC: Robustify sret test regex
Replace old-style, brittle, grep with new-fangled FileCheck technology.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D137941
2022-11-21 14:20:47 -05:00

24 lines
575 B
C

// RUN: %clang_cc1 %s -Wno-strict-prototypes -emit-llvm -o - | FileCheck %s
struct abc {
long a;
long b;
long c;
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)
}