Files
clang-p2996/clang/test/CodeGen/2006-05-19-SingleEltReturn.c
Aaron Ballman 1ea584377e A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the ninth batch of tests being updated (there are a
significant number of other tests left to be updated).
2022-02-13 08:03:40 -05:00

31 lines
633 B
C

// Test returning a single element aggregate value containing a double.
// RUN: %clang_cc1 -triple i686-linux %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_32
// RUN: %clang_cc1 %s -emit-llvm -o -
struct X {
double D;
};
struct Y {
struct X x;
};
struct Y bar(void);
void foo(struct Y *P) {
*P = bar();
}
struct Y bar(void) {
struct Y a;
a.x.D = 0;
return a;
}
// X86_32: define{{.*}} void @foo(%struct.Y* noundef %P)
// X86_32: call void @bar(%struct.Y* sret(%struct.Y) align 4 %{{[^),]*}})
// X86_32: define{{.*}} void @bar(%struct.Y* noalias sret(%struct.Y) align 4 %{{[^,)]*}})
// X86_32: ret void