xref: /llvm-project/clang/test/CodeGen/arm64_32.c (revision 158d72d728261c1e54dc77931372b2322c52849f)
1 // RUN: %clang_cc1 -triple arm64_32-apple-ios7.0 -emit-llvm -o - %s | FileCheck %s
2 
3 struct Foo {
4   char a;
5   int b : 1;
6 };
7 
8 int BitfieldOffset = sizeof(struct Foo);
9 // CHECK: @BitfieldOffset ={{.*}} global i32 2
10 
11 int PointerSize = sizeof(void *);
12 // CHECK: @PointerSize ={{.*}} global i32 4
13 
14 int PointerAlign = __alignof(void *);
15 // CHECK: @PointerAlign ={{.*}} global i32 4
16 
17 int LongSize = sizeof(long);
18 // CHECK: @LongSize ={{.*}} global i32 4
19 
20 int LongAlign = __alignof(long);
21 // CHECK: @LongAlign ={{.*}} global i32 4
22 
23 // Not expected to change, but it's a difference between AAPCS and DarwinPCS
24 // that we need to be preserved for compatibility with ARMv7k.
25 long double LongDoubleVar = 0.0;
26 // CHECK: @LongDoubleVar ={{.*}} global double
27 
28 typedef float __attribute__((ext_vector_type(16))) v16f32;
func(v16f32 in)29 v16f32 func(v16f32 in) { return in; }
30 // CHECK: define{{.*}} void @func(ptr dead_on_unwind noalias writable sret(<16 x float>) align 16 {{%.*}}, <16 x float> noundef {{%.*}})
31