Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / sret.c
blob548581d3e3dc661907057018caa12b526c9756d3
1 // RUN: %clang_cc1 %s -Wno-strict-prototypes -emit-llvm -o - | FileCheck %s
3 struct abc {
4 long a;
5 long b;
6 long c;
7 long d;
8 long e;
9 };
11 struct abc foo1(void);
12 // CHECK-DAG: declare {{.*}} @foo1(ptr sret(%struct.abc)
13 struct abc foo2();
14 // CHECK-DAG: declare {{.*}} @foo2(ptr sret(%struct.abc)
15 struct abc foo3(void){}
16 // CHECK-DAG: define {{.*}} @foo3(ptr noalias sret(%struct.abc)
18 void bar(void) {
19 struct abc dummy1 = foo1();
20 // CHECK-DAG: call {{.*}} @foo1(ptr sret(%struct.abc)
21 struct abc dummy2 = foo2();
22 // CHECK-DAG: call {{.*}} @foo2(ptr sret(%struct.abc)