Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / 2006-05-19-SingleEltReturn.c
blob16eacf3ec16258f83f0b422c69fd277d55da9ed6
1 // Test returning a single element aggregate value containing a double.
2 // RUN: %clang_cc1 -triple i686-linux %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_32
3 // RUN: %clang_cc1 %s -emit-llvm -o -
5 struct X {
6 double D;
7 };
9 struct Y {
10 struct X x;
13 struct Y bar(void);
15 void foo(struct Y *P) {
16 *P = bar();
19 struct Y bar(void) {
20 struct Y a;
21 a.x.D = 0;
22 return a;
26 // X86_32: define{{.*}} void @foo(ptr noundef %P)
27 // X86_32: call void @bar(ptr sret(%struct.Y) align 4 %{{[^),]*}})
29 // X86_32: define{{.*}} void @bar(ptr noalias sret(%struct.Y) align 4 %{{[^,)]*}})
30 // X86_32: ret void