Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / X86 / x86_32-fpcc-struct-return.c
blob2cfd4378c34783df58a7a56ee4675239d2dec6e0
1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
2 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fpcc-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
3 // RUN: %clang_cc1 -triple i386-apple-darwin9 -freg-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
4 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
5 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -fpcc-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
6 // RUN: %clang_cc1 -triple i386-pc-linux-gnu -freg-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
7 // RUN: %clang_cc1 -triple i386-pc-win32 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
8 // RUN: %clang_cc1 -triple i386-pc-win32 -fpcc-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-PCC
9 // RUN: %clang_cc1 -triple i386-pc-win32 -freg-struct-return -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-REG
11 typedef struct { int a,b,c,d; } Big;
12 typedef struct { int i; } Small;
13 typedef struct { short s; } Short;
14 typedef struct { } ZeroSized;
16 // CHECK-LABEL: define void @returnBig
17 // CHECK: ret void
18 Big returnBig(Big x) { return x; }
20 // CHECK-PCC-LABEL: define {{(dso_local )?}}void @returnSmall
21 // CHECK-PCC: ret void
22 // CHECK-REG-LABEL: define {{(dso_local )?}}i32 @returnSmall
23 // CHECK-REG: ret i32
24 Small returnSmall(Small x) { return x; }
26 // CHECK-PCC-LABEL: define {{(dso_local )?}}void @returnShort
27 // CHECK-PCC: ret void
28 // CHECK-REG-LABEL: define {{(dso_local )?}}i16 @returnShort
29 // CHECK-REG: ret i16
30 Short returnShort(Short x) { return x; }
32 // CHECK-LABEL: define void @returnZero()
33 // CHECK: ret void
34 ZeroSized returnZero(ZeroSized x) { return x; }