File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -254,8 +254,8 @@ class ConstExprEmitter
254254 }
255255
256256 mlir::Attribute VisitStringLiteral (StringLiteral *e, QualType t) {
257- cgm. errorNYI (e-> getBeginLoc (), " ConstExprEmitter::VisitStringLiteral " );
258- return {} ;
257+ // This is a string literal initializing an array in an initializer.
258+ return cgm. getConstantArrayFromStringLiteral (e) ;
259259 }
260260
261261 mlir::Attribute VisitObjCEncodeExpr (ObjCEncodeExpr *e, QualType t) {
Original file line number Diff line number Diff line change 55// RUN: %clang_cc1 -triple aarch64-none-linux-android21 -emit-llvm %s -o %t.ll
66// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
77
8+ char g_str [] = "1234" ;
9+
10+ // CIR: cir.global external @g_str = #cir.const_array<"1234\00" : !cir.array<!s8i x 5>> : !cir.array<!s8i x 5>
11+
812// CIR: cir.global "private" cir_private dsolocal @[[STR1_GLOBAL:.*]] = #cir.const_array<"1\00" : !cir.array<!s8i x 2>> : !cir.array<!s8i x 2>
913// CIR: cir.global "private" cir_private dsolocal @[[STR2_GLOBAL:.*]] = #cir.zero : !cir.array<!s8i x 1>
1014// CIR: cir.global "private" cir_private dsolocal @[[STR3_GLOBAL:.*]] = #cir.zero : !cir.array<!s8i x 2>
You can’t perform that action at this time.
0 commit comments