blob: b8d497c5580def6fcf03ebdf9121058ae351bcd9 [file] [log] [blame]
James Molloy90d61012014-08-29 10:17:52 +00001// REQUIRES: aarch64-registered-target
2// RUN: %clang_cc1 -triple aarch64_be-linux-gnu -ffreestanding -emit-llvm -O0 -o - %s | FileCheck --check-prefix IR %s
3// RUN: %clang_cc1 -triple aarch64_be-linux-gnu -ffreestanding -S -O1 -o - %s | FileCheck --check-prefix ARM %s
James Molloy491cefb2014-05-07 17:41:15 +00004
5struct bt3 { signed b2:10; signed b3:10; } b16;
6
James Molloy90d61012014-08-29 10:17:52 +00007// Get the high 32-bits and then shift appropriately for big-endian.
James Molloy491cefb2014-05-07 17:41:15 +00008signed callee_b0f(struct bt3 bp11) {
James Molloy90d61012014-08-29 10:17:52 +00009// IR: callee_b0f(i64 [[ARG:%.*]])
10// IR: store i64 [[ARG]], i64* [[PTR:%.*]]
11// IR: [[BITCAST:%.*]] = bitcast i64* [[PTR]] to i8*
12// IR: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* [[BITCAST]], i64 4
13// ARM: asr x0, x0, #54
James Molloy491cefb2014-05-07 17:41:15 +000014 return bp11.b2;
15}