https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/156036
>From a79c57ee6cedd19ea15565fe7e7ca9872d416f2c Mon Sep 17 00:00:00 2001 From: Morris Hafner <mhaf...@nvidia.com> Date: Fri, 29 Aug 2025 16:45:44 +0200 Subject: [PATCH 1/2] [CIR] Add value initialization for scalar types --- clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp | 9 +- clang/test/CIR/CodeGen/local-vars.cpp | 194 ++++++++++++++++----- 2 files changed, 155 insertions(+), 48 deletions(-) diff --git a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp index 46934e7155adf..6b768c5e9d30d 100644 --- a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp @@ -92,6 +92,10 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> { mlir::Value value, CastKind kind, QualType destTy); + mlir::Value emitNullValue(QualType ty, mlir::Location loc) { + return cgf.cgm.emitNullConstant(ty, loc); + } + mlir::Value emitPromotedValue(mlir::Value result, QualType promotionType) { return builder.createFloatingCast(result, cgf.convertType(promotionType)); } @@ -1967,9 +1971,8 @@ mlir::Value ScalarExprEmitter::VisitInitListExpr(InitListExpr *e) { } if (numInitElements == 0) { - cgf.cgm.errorNYI(e->getSourceRange(), - "InitListExpr Non VectorType with 0 init elements"); - return {}; + // C++11 value-initialization for the scalar. + return emitNullValue(e->getType(), cgf.getLoc(e->getExprLoc())); } return Visit(e->getInit(0)); diff --git a/clang/test/CIR/CodeGen/local-vars.cpp b/clang/test/CIR/CodeGen/local-vars.cpp index 9385fdfa65601..fc0eea9bc5338 100644 --- a/clang/test/CIR/CodeGen/local-vars.cpp +++ b/clang/test/CIR/CodeGen/local-vars.cpp @@ -1,5 +1,9 @@ -// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t-cir.ll -// RUN: FileCheck -input-file=%t-cir.ll %s +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir +// RUN: FileCheck --input-file=%t.cir %s --check-prefix=CIR +// RUN: %clang_cc1 -std=c++17 -triple x86_64-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 -std=c++17 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll +// RUN: FileCheck --input-file=%t.ll %s --check-prefix=OGCG void test() { int i = 1; @@ -21,46 +25,146 @@ void test() { bool uib; } -// CHECK: module -// CHECK: cir.func{{.*}} @_Z4testv() -// CHECK: %[[I_PTR:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["i", init] {alignment = 4 : i64} -// CHECK: %[[L_PTR:.*]] = cir.alloca !s64i, !cir.ptr<!s64i>, ["l", init] {alignment = 8 : i64} -// CHECK: %[[F_PTR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f", init] {alignment = 4 : i64} -// CHECK: %[[D_PTR:.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["d", init] {alignment = 8 : i64} -// CHECK: %[[B1_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b1", init] {alignment = 1 : i64} -// CHECK: %[[B2_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b2", init] {alignment = 1 : i64} -// CHECK: %[[CI_PTR:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["ci", init, const] {alignment = 4 : i64} -// CHECK: %[[CL_PTR:.*]] = cir.alloca !s64i, !cir.ptr<!s64i>, ["cl", init, const] {alignment = 8 : i64} -// CHECK: %[[CF_PTR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["cf", init, const] {alignment = 4 : i64} -// CHECK: %[[CD_PTR:.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["cd", init, const] {alignment = 8 : i64} -// CHECK: %[[CB1_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["cb1", init, const] {alignment = 1 : i64} -// CHECK: %[[CB2_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["cb2", init, const] {alignment = 1 : i64} -// CHECK: %[[UII_PTR:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["uii"] {alignment = 4 : i64} -// CHECK: %[[UIL_PTR:.*]] = cir.alloca !s64i, !cir.ptr<!s64i>, ["uil"] {alignment = 8 : i64} -// CHECK: %[[UIF_PTR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["uif"] {alignment = 4 : i64} -// CHECK: %[[UID_PTR:.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["uid"] {alignment = 8 : i64} -// CHECK: %[[UIB_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["uib"] {alignment = 1 : i64} -// CHECK: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i -// CHECK: cir.store align(4) %[[ONE]], %[[I_PTR]] : !s32i, !cir.ptr<!s32i> -// CHECK: %[[TWO:.*]] = cir.const #cir.int<2> : !s64i -// CHECK: cir.store align(8) %[[TWO]], %[[L_PTR]] : !s64i, !cir.ptr<!s64i> -// CHECK: %[[THREE:.*]] = cir.const #cir.fp<3.0{{.*}}> : !cir.float -// CHECK: cir.store align(4) %[[THREE]], %[[F_PTR]] : !cir.float, !cir.ptr<!cir.float> -// CHECK: %[[FOUR:.*]] = cir.const #cir.fp<4.0{{.*}}> : !cir.double -// CHECK: cir.store align(8) %[[FOUR]], %[[D_PTR]] : !cir.double, !cir.ptr<!cir.double> -// CHECK: %[[TRUE:.*]] = cir.const #true -// CHECK: cir.store align(1) %[[TRUE]], %[[B1_PTR]] : !cir.bool, !cir.ptr<!cir.bool> -// CHECK: %[[FALSE:.*]] = cir.const #false -// CHECK: cir.store align(1) %[[FALSE]], %[[B2_PTR]] : !cir.bool, !cir.ptr<!cir.bool> -// CHECK: %[[ONEC:.*]] = cir.const #cir.int<1> : !s32i -// CHECK: cir.store align(4) %[[ONEC]], %[[CI_PTR]] : !s32i, !cir.ptr<!s32i> -// CHECK: %[[TWOC:.*]] = cir.const #cir.int<2> : !s64i -// CHECK: cir.store align(8) %[[TWOC]], %[[CL_PTR]] : !s64i, !cir.ptr<!s64i> -// CHECK: %[[THREEC:.*]] = cir.const #cir.fp<3.0{{.*}}> : !cir.float -// CHECK: cir.store align(4) %[[THREEC]], %[[CF_PTR]] : !cir.float, !cir.ptr<!cir.float> -// CHECK: %[[FOURC:.*]] = cir.const #cir.fp<4.0{{.*}}> : !cir.double -// CHECK: cir.store align(8) %[[FOURC]], %[[CD_PTR]] : !cir.double, !cir.ptr<!cir.double> -// CHECK: %[[TRUEC:.*]] = cir.const #true -// CHECK: cir.store align(1) %[[TRUEC]], %[[CB1_PTR]] : !cir.bool, !cir.ptr<!cir.bool> -// CHECK: %[[FALSEC:.*]] = cir.const #false -// CHECK: cir.store align(1) %[[FALSEC]], %[[CB2_PTR]] : !cir.bool, !cir.ptr<!cir.bool> +// CIR: module +// CIR: cir.func{{.*}} @_Z4testv() +// CIR: %[[I_PTR:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["i", init] {alignment = 4 : i64} +// CIR: %[[L_PTR:.*]] = cir.alloca !s64i, !cir.ptr<!s64i>, ["l", init] {alignment = 8 : i64} +// CIR: %[[F_PTR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f", init] {alignment = 4 : i64} +// CIR: %[[D_PTR:.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["d", init] {alignment = 8 : i64} +// CIR: %[[B1_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b1", init] {alignment = 1 : i64} +// CIR: %[[B2_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b2", init] {alignment = 1 : i64} +// CIR: %[[CI_PTR:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["ci", init, const] {alignment = 4 : i64} +// CIR: %[[CL_PTR:.*]] = cir.alloca !s64i, !cir.ptr<!s64i>, ["cl", init, const] {alignment = 8 : i64} +// CIR: %[[CF_PTR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["cf", init, const] {alignment = 4 : i64} +// CIR: %[[CD_PTR:.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["cd", init, const] {alignment = 8 : i64} +// CIR: %[[CB1_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["cb1", init, const] {alignment = 1 : i64} +// CIR: %[[CB2_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["cb2", init, const] {alignment = 1 : i64} +// CIR: %[[UII_PTR:.*]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["uii"] {alignment = 4 : i64} +// CIR: %[[UIL_PTR:.*]] = cir.alloca !s64i, !cir.ptr<!s64i>, ["uil"] {alignment = 8 : i64} +// CIR: %[[UIF_PTR:.*]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["uif"] {alignment = 4 : i64} +// CIR: %[[UID_PTR:.*]] = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["uid"] {alignment = 8 : i64} +// CIR: %[[UIB_PTR:.*]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["uib"] {alignment = 1 : i64} +// CIR: %[[ONE:.*]] = cir.const #cir.int<1> : !s32i +// CIR: cir.store align(4) %[[ONE]], %[[I_PTR]] : !s32i, !cir.ptr<!s32i> +// CIR: %[[TWO:.*]] = cir.const #cir.int<2> : !s64i +// CIR: cir.store align(8) %[[TWO]], %[[L_PTR]] : !s64i, !cir.ptr<!s64i> +// CIR: %[[THREE:.*]] = cir.const #cir.fp<3.0{{.*}}> : !cir.float +// CIR: cir.store align(4) %[[THREE]], %[[F_PTR]] : !cir.float, !cir.ptr<!cir.float> +// CIR: %[[FOUR:.*]] = cir.const #cir.fp<4.0{{.*}}> : !cir.double +// CIR: cir.store align(8) %[[FOUR]], %[[D_PTR]] : !cir.double, !cir.ptr<!cir.double> +// CIR: %[[TRUE:.*]] = cir.const #true +// CIR: cir.store align(1) %[[TRUE]], %[[B1_PTR]] : !cir.bool, !cir.ptr<!cir.bool> +// CIR: %[[FALSE:.*]] = cir.const #false +// CIR: cir.store align(1) %[[FALSE]], %[[B2_PTR]] : !cir.bool, !cir.ptr<!cir.bool> +// CIR: %[[ONEC:.*]] = cir.const #cir.int<1> : !s32i +// CIR: cir.store align(4) %[[ONEC]], %[[CI_PTR]] : !s32i, !cir.ptr<!s32i> +// CIR: %[[TWOC:.*]] = cir.const #cir.int<2> : !s64i +// CIR: cir.store align(8) %[[TWOC]], %[[CL_PTR]] : !s64i, !cir.ptr<!s64i> +// CIR: %[[THREEC:.*]] = cir.const #cir.fp<3.0{{.*}}> : !cir.float +// CIR: cir.store align(4) %[[THREEC]], %[[CF_PTR]] : !cir.float, !cir.ptr<!cir.float> +// CIR: %[[FOURC:.*]] = cir.const #cir.fp<4.0{{.*}}> : !cir.double +// CIR: cir.store align(8) %[[FOURC]], %[[CD_PTR]] : !cir.double, !cir.ptr<!cir.double> +// CIR: %[[TRUEC:.*]] = cir.const #true +// CIR: cir.store align(1) %[[TRUEC]], %[[CB1_PTR]] : !cir.bool, !cir.ptr<!cir.bool> +// CIR: %[[FALSEC:.*]] = cir.const #false +// CIR: cir.store align(1) %[[FALSEC]], %[[CB2_PTR]] : !cir.bool, !cir.ptr<!cir.bool> + +// LLVM: define dso_local void @_Z4testv() +// LLVM: %[[I_PTR:.+]] = alloca i32 +// LLVM: %[[L_PTR:.+]] = alloca i64 +// LLVM: %[[F_PTR:.+]] = alloca float +// LLVM: %[[D_PTR:.+]] = alloca double +// LLVM: %[[B1_PTR:.+]] = alloca i8 +// LLVM: %[[B2_PTR:.+]] = alloca i8 +// LLVM: %[[CI_PTR:.+]] = alloca i32 +// LLVM: %[[CL_PTR:.+]] = alloca i64 +// LLVM: %[[CF_PTR:.+]] = alloca float +// LLVM: %[[CD_PTR:.+]] = alloca double +// LLVM: %[[CB1_PTR:.+]] = alloca i8 +// LLVM: %[[CB2_PTR:.+]] = alloca i8 +// LLVM: %[[UII_PTR:.+]] = alloca i32 +// LLVM: %[[UIL_PTR:.+]] = alloca i64 +// LLVM: %[[UIF_PTR:.+]] = alloca float +// LLVM: %[[UID_PTR:.+]] = alloca double +// LLVM: %[[UIB_PTR:.+]] = alloca i8 +// LLVM: store i32 1, ptr %[[I_PTR]] +// LLVM: store i64 2, ptr %[[L_PTR]] +// LLVM: store float 3.000000e+00, ptr %[[F_PTR]] +// LLVM: store double 4.000000e+00, ptr %[[D_PTR]] +// LLVM: store i8 1, ptr %[[B1_PTR]] +// LLVM: store i8 0, ptr %[[B2_PTR]] +// LLVM: store i32 1, ptr %[[CI_PTR]] +// LLVM: store i64 2, ptr %[[CL_PTR]] +// LLVM: store float 3.000000e+00, ptr %[[CF_PTR]] +// LLVM: store double 4.000000e+00, ptr %[[CD_PTR]] +// LLVM: store i8 1, ptr %[[CB1_PTR]] +// LLVM: store i8 0, ptr %[[CB2_PTR]] +// LLVM: ret void + +// OGCG: define dso_local void @_Z4testv() +// OGCG: %[[I_PTR:.+]] = alloca i32 +// OGCG: %[[L_PTR:.+]] = alloca i64 +// OGCG: %[[F_PTR:.+]] = alloca float +// OGCG: %[[D_PTR:.+]] = alloca double +// OGCG: %[[B1_PTR:.+]] = alloca i8 +// OGCG: %[[B2_PTR:.+]] = alloca i8 +// OGCG: %[[CI_PTR:.+]] = alloca i32 +// OGCG: %[[CL_PTR:.+]] = alloca i64 +// OGCG: %[[CF_PTR:.+]] = alloca float +// OGCG: %[[CD_PTR:.+]] = alloca double +// OGCG: %[[CB1_PTR:.+]] = alloca i8 +// OGCG: %[[CB2_PTR:.+]] = alloca i8 +// OGCG: %[[UII_PTR:.+]] = alloca i32 +// OGCG: %[[UIL_PTR:.+]] = alloca i64 +// OGCG: %[[UIF_PTR:.+]] = alloca float +// OGCG: %[[UID_PTR:.+]] = alloca double +// OGCG: %[[UIB_PTR:.+]] = alloca i8 +// OGCG: store i32 1, ptr %[[I_PTR]] +// OGCG: store i64 2, ptr %[[L_PTR]] +// OGCG: store float 3.000000e+00, ptr %[[F_PTR]] +// OGCG: store double 4.000000e+00, ptr %[[D_PTR]] +// OGCG: store i8 1, ptr %[[B1_PTR]] +// OGCG: store i8 0, ptr %[[B2_PTR]] +// OGCG: store i32 1, ptr %[[CI_PTR]] +// OGCG: store i64 2, ptr %[[CL_PTR]] +// OGCG: store float 3.000000e+00, ptr %[[CF_PTR]] +// OGCG: store double 4.000000e+00, ptr %[[CD_PTR]] +// OGCG: store i8 1, ptr %[[CB1_PTR]] +// OGCG: store i8 0, ptr %[[CB2_PTR]] +// OGCG: ret void + +void value_init() { + float f{}; + bool b{}; + int i{}; +} + +// CIR: cir.func{{.*}} @_Z10value_initv() +// CIR: %[[F_PTR:.+]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f", init] +// CIR: %[[B_PTR:.+]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b", init] +// CIR: %[[I_PTR:.+]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["i", init] +// CIR: %[[ZEROF:.+]] = cir.const #cir.fp<0.000000e+00> : !cir.float +// CIR: cir.store {{.*}} %[[ZEROF]], %[[F_PTR]] : !cir.float, !cir.ptr<!cir.float> +// CIR: %[[FALSE:.+]] = cir.const #false +// CIR: cir.store {{.*}} %[[FALSE]], %[[B_PTR]] : !cir.bool, !cir.ptr<!cir.bool> +// CIR: %[[ZEROI:.+]] = cir.const #cir.int<0> : !s32i +// CIR: cir.store {{.*}} %[[ZEROI]], %[[I_PTR]] : !s32i, !cir.ptr<!s32i> +// CIR: cir.return + +// LLVM: define dso_local void @_Z10value_initv() +// LLVM: %[[F_PTR:.+]] = alloca float +// LLVM: %[[B_PTR:.+]] = alloca i8 +// LLVM: %[[I_PTR:.+]] = alloca i32 +// LLVM: store float 0.000000e+00, ptr %[[F_PTR]] +// LLVM: store i8 0, ptr %[[B_PTR]] +// LLVM: store i32 0, ptr %[[I_PTR]] +// LLVM: ret void + +// OGCG: define dso_local void @_Z10value_initv() +// OGCG: %[[F_PTR:.+]] = alloca float +// OGCG: %[[B_PTR:.+]] = alloca i8 +// OGCG: %[[I_PTR:.+]] = alloca i32 +// OGCG: store float 0.000000e+00, ptr %[[F_PTR]] +// OGCG: store i8 0, ptr %[[B_PTR]] +// OGCG: store i32 0, ptr %[[I_PTR]] +// OGCG: ret void >From 025a286f9116de3d96d1507cb018dc017a0d75da Mon Sep 17 00:00:00 2001 From: Morris Hafner <mhaf...@nvidia.com> Date: Fri, 29 Aug 2025 17:01:02 +0200 Subject: [PATCH 2/2] Add CXXScalarValueInitExpr visitor --- clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp | 7 +++++++ clang/test/CIR/CodeGen/local-vars.cpp | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp index 6b768c5e9d30d..b219d3b94e690 100644 --- a/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp @@ -186,6 +186,13 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> { return builder.getBool(e->getValue(), cgf.getLoc(e->getExprLoc())); } + mlir::Value VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *e) { + if (e->getType()->isVoidType()) + return {}; + + return emitNullValue(e->getType(), cgf.getLoc(e->getSourceRange())); + } + mlir::Value VisitCastExpr(CastExpr *e); mlir::Value VisitCallExpr(const CallExpr *e); diff --git a/clang/test/CIR/CodeGen/local-vars.cpp b/clang/test/CIR/CodeGen/local-vars.cpp index fc0eea9bc5338..593527846e687 100644 --- a/clang/test/CIR/CodeGen/local-vars.cpp +++ b/clang/test/CIR/CodeGen/local-vars.cpp @@ -137,34 +137,45 @@ void value_init() { float f{}; bool b{}; int i{}; + + bool scalar_value_init_expr = int() == 0; } // CIR: cir.func{{.*}} @_Z10value_initv() // CIR: %[[F_PTR:.+]] = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["f", init] // CIR: %[[B_PTR:.+]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["b", init] // CIR: %[[I_PTR:.+]] = cir.alloca !s32i, !cir.ptr<!s32i>, ["i", init] +// CIR: %[[S_PTR:.+]] = cir.alloca !cir.bool, !cir.ptr<!cir.bool>, ["scalar_value_init_expr", init] // CIR: %[[ZEROF:.+]] = cir.const #cir.fp<0.000000e+00> : !cir.float // CIR: cir.store {{.*}} %[[ZEROF]], %[[F_PTR]] : !cir.float, !cir.ptr<!cir.float> // CIR: %[[FALSE:.+]] = cir.const #false // CIR: cir.store {{.*}} %[[FALSE]], %[[B_PTR]] : !cir.bool, !cir.ptr<!cir.bool> // CIR: %[[ZEROI:.+]] = cir.const #cir.int<0> : !s32i // CIR: cir.store {{.*}} %[[ZEROI]], %[[I_PTR]] : !s32i, !cir.ptr<!s32i> +// CIR: %[[ZEROI2:.+]] = cir.const #cir.int<0> : !s32i +// CIR: %[[ZEROI3:.+]] = cir.const #cir.int<0> : !s32i +// CIR: %[[CMP:.+]] = cir.cmp(eq, %[[ZEROI2]], %[[ZEROI3]]) : !s32i, !cir.bool +// CIR: cir.store {{.*}} %[[CMP]], %[[S_PTR]] : !cir.bool, !cir.ptr<!cir.bool> // CIR: cir.return -// LLVM: define dso_local void @_Z10value_initv() +// LLVM: define{{.*}} void @_Z10value_initv() // LLVM: %[[F_PTR:.+]] = alloca float // LLVM: %[[B_PTR:.+]] = alloca i8 // LLVM: %[[I_PTR:.+]] = alloca i32 +// LLVM: %[[S_PTR:.+]] = alloca i8 // LLVM: store float 0.000000e+00, ptr %[[F_PTR]] // LLVM: store i8 0, ptr %[[B_PTR]] // LLVM: store i32 0, ptr %[[I_PTR]] +// LLVM: store i8 1, ptr %[[S_PTR]] // LLVM: ret void -// OGCG: define dso_local void @_Z10value_initv() +// OGCG: define{{.*}} void @_Z10value_initv() // OGCG: %[[F_PTR:.+]] = alloca float // OGCG: %[[B_PTR:.+]] = alloca i8 // OGCG: %[[I_PTR:.+]] = alloca i32 +// OGCG: %[[S_PTR:.+]] = alloca i8 // OGCG: store float 0.000000e+00, ptr %[[F_PTR]] // OGCG: store i8 0, ptr %[[B_PTR]] // OGCG: store i32 0, ptr %[[I_PTR]] +// OGCG: store i8 1, ptr %[[S_PTR]] // OGCG: ret void _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits