Create local string using LLVM
问题 I'm trying to create a local variable using LLVM to store strings, but my code is currently throwing a syntax error. lli: test2.ll:8:23: error: constant expression type mismatch %1 = load [6 x i8]* c"hello\00" My IR code that allocates and store the string: @.string = private constant [4 x i8] c"%s\0A\00" define void @main() { entry: %a = alloca [255 x i8] %0 = bitcast [255 x i8]* %a to i8* %1 = load [6 x i8]* c"hello\00" %2 = bitcast [6 x i8]* %1 to i8* %3 = tail call i8* @strncpy(i8* %0, i8