llvm-project/clang/test/CIR/CodeGen/bitfields_be.c
Andres-Salamanca f4d31cdee3
[CIR] Add bitfield offset calculation for big-endian targets (#145067)
This PR updates the bitfield offset calculation to correctly handle
big-endian architectures.
2025-06-23 14:20:26 -05:00

18 lines
642 B
C

// RUN: %clang_cc1 -triple aarch64_be-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir %s --check-prefix=CIR
// RUN: %clang_cc1 -triple aarch64_be-unknown-linux-gnu -fclangir -emit-llvm %s -o %t-cir.ll
// RUN: FileCheck --input-file=%t-cir.ll %s --check-prefix=LLVM
// RUN: %clang_cc1 -triple aarch64_be-unknown-linux-gnu -emit-llvm %s -o %t.ll
// RUN: FileCheck --input-file=%t.ll %s --check-prefix=OGCG
typedef struct {
int a : 4;
int b : 11;
int c : 17;
} S;
S s;
// CIR: !rec_S = !cir.record<struct "S" {!u32i}>
// LLVM: %struct.S = type { i32 }
// OGCG: %struct.S = type { i32 }