[clang] [clang] Lower _BitInt(129+) to a different type in LLVM IR (PR #91364)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 10 10:19:52 PDT 2024
================
@@ -1,12 +1,25 @@
-// RUN: %clang_cc1 -triple x86_64-gnu-linux -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK64
-// RUN: %clang_cc1 -triple x86_64-windows-pc -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK64
-// RUN: %clang_cc1 -triple i386-gnu-linux -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN32
-// RUN: %clang_cc1 -triple i386-windows-pc -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN32
+// RUN: %clang_cc1 -std=c23 -triple x86_64-gnu-linux -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK64,LIN64
+// RUN: %clang_cc1 -std=c23 -triple x86_64-windows-pc -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK64,WIN64
+// RUN: %clang_cc1 -std=c23 -triple i386-gnu-linux -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,LIN32
+// RUN: %clang_cc1 -std=c23 -triple i386-windows-pc -O3 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK,WIN32
+
+// CHECK64: %struct.S1 = type { i17, [4 x i8], [24 x i8] }
+// WIN32: %struct.S1 = type { i17, [4 x i8], [24 x i8] }
+// LIN32: %struct.S1 = type { i17, [20 x i8] }
+// CHECK64: %struct.S2 = type { [40 x i8], i32, [4 x i8] }
+// WIN32: %struct.S2 = type { [40 x i8], i32, [4 x i8] }
+// LIN32: %struct.S2 = type { [36 x i8], i32 }
+// LIN64: %struct.S3 = type { [17 x i8], [7 x i8] }
+// WIN64: %struct.S3 = type { [24 x i8] }
//GH62207
unsigned _BitInt(1) GlobSize1 = 0;
// CHECK: @GlobSize1 = {{.*}}global i1 false
+// CHECK64: @__const.foo.A = private unnamed_addr constant { i17, [4 x i8], <{ i8, [23 x i8] }> } { i17 1, [4 x i8] undef, <{ i8, [23 x i8] }> <{ i8 -86, [23 x i8] zeroinitializer }> }, align 8
----------------
Fznamznon wrote:
Ok, now it is i32. In fact, all _BitInt types now have memory layout type with a whole number of bytes. Please let me know if I got the idea right.
That broke almost every _BitInt test clang has, I fixed some of them, but I didn't manage to fix all.
https://github.com/llvm/llvm-project/pull/91364
More information about the cfe-commits
mailing list