Skip to content

Commit 806f5d6

Browse files
committed
[Clang] Fix incorrect passing of _BitInt args
1 parent 908693b commit 806f5d6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clang/lib/CodeGen/Targets/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadic,
302302

303303
if (const auto *EIT = Ty->getAs<BitIntType>())
304304
if (EIT->getNumBits() > 128)
305-
return getNaturalAlignIndirect(Ty);
305+
return getNaturalAlignIndirect(Ty, false);
306306

307307
return (isPromotableIntegerTypeForABI(Ty) && isDarwinPCS()
308308
? ABIArgInfo::getExtend(Ty)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// REQUIRES: arm-registered-target
2+
// RUN: %clang_cc1 -triple aarch64-none-elf \
3+
// RUN: -O2 \
4+
// RUN: -emit-llvm -fexperimental-max-bitint-width=1024 -o - %s | FileCheck %s
5+
6+
_BitInt(129) v = -1;
7+
int h(_BitInt(129));
8+
9+
// CHECK: declare i32 @h(ptr noundef)
10+
int largerthan128() {
11+
return h(v);
12+
}
13+
14+

0 commit comments

Comments
 (0)