1 // RUN: %clang_cc1 -no-opaque-pointers -triple avr -target-cpu atmega328 -emit-llvm %s -o - \
2 // RUN: | FileCheck %s --check-prefix=AVR
3 // RUN: %clang_cc1 -no-opaque-pointers -triple avr -target-cpu attiny40 -emit-llvm %s -o - \
4 // RUN: | FileCheck %s --check-prefix=TINY
5
6 // Structure that is more than 8 bytes.
7 struct s10 {
8 int a, b, c, d, e;
9 };
10
11 // Structure that is less than 8 bytes but more than 4 bytes.
12 struct s06 {
13 int a, b, c;
14 };
15
16 // Structure that is less than 4 bytes.
17 struct s04 {
18 int a, b;
19 };
20
foo10(int a,int b,int c)21 struct s10 foo10(int a, int b, int c) {
22 struct s10 a0;
23 return a0;
24 }
25
foo06(int a,int b,int c)26 struct s06 foo06(int a, int b, int c) {
27 struct s06 a0;
28 return a0;
29 }
30
foo04(int a,int b)31 struct s04 foo04(int a, int b) {
32 struct s04 a0;
33 return a0;
34 }
35
36 // AVR: %struct.s10 = type { i16, i16, i16, i16, i16 }
37 // AVR: %struct.s06 = type { i16, i16, i16 }
38 // AVR: %struct.s04 = type { i16, i16 }
39 // AVR: define{{.*}} void @foo10(%struct.s10* {{.*}}, i16 noundef %a, i16 noundef %b, i16 noundef %c)
40 // AVR: define{{.*}} %struct.s06 @foo06(i16 noundef %a, i16 noundef %b, i16 noundef %c)
41 // AVR: define{{.*}} %struct.s04 @foo04(i16 noundef %a, i16 noundef %b)
42
43 // TINY: %struct.s10 = type { i16, i16, i16, i16, i16 }
44 // TINY: %struct.s06 = type { i16, i16, i16 }
45 // TINY: %struct.s04 = type { i16, i16 }
46 // TINY: define{{.*}} void @foo10(%struct.s10* {{.*}}, i16 noundef %a, i16 noundef %b, i16 noundef %c)
47 // TINY: define{{.*}} void @foo06(%struct.s06* {{.*}}, i16 noundef %a, i16 noundef %b, i16 noundef %c)
48 // TINY: define{{.*}} %struct.s04 @foo04(i16 noundef %a, i16 noundef %b)
49