Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / arm-be-result-return.c
blob5796cb74a8e85e97ed5d42979f381b033dabba20
1 // RUN: %clang_cc1 -triple armebv7-arm-none-eabi -emit-llvm -w -o - %s | FileCheck %s
3 // this tests for AAPCS section 5.4:
4 // A Composite Type not larger than 4 bytes is returned in r0.
5 // The format is as if the result had been stored in memory at a
6 // word-aligned address and then loaded into r0 with an LDR instruction
8 extern union Us { short s; } us;
9 union Us callee_us(void) { return us; }
10 // CHECK-LABEL: callee_us()
11 // CHECK: zext i16
12 // CHECK: shl
13 // CHECK: ret i32
15 void caller_us(void) {
16 us = callee_us();
17 // CHECK-LABEL: caller_us()
18 // CHECK: call i32
19 // CHECK: lshr i32
20 // CHECK: trunc i32
23 extern struct Ss { short s; } ss;
24 struct Ss callee_ss(void) { return ss; }
25 // CHECK-LABEL: callee_ss()
26 // CHECK: zext i16
27 // CHECK: shl
28 // CHECK: ret i32
30 void caller_ss(void) {
31 ss = callee_ss();
32 // CHECK-LABEL: caller_ss()
33 // CHECK: call i32
34 // CHECK: lshr i32
35 // CHECK: trunc i32