xref: /aosp_15_r20/external/clang/test/CodeGen/darwin-string-literals.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-LSB %s
2*67e74705SXin Li 
3*67e74705SXin Li // CHECK-LSB: @.str = private unnamed_addr constant [8 x i8] c"string0\00"
4*67e74705SXin Li // CHECK-LSB: @.str.1 = private unnamed_addr constant [8 x i8] c"string1\00"
5*67e74705SXin Li // CHECK-LSB: @.str.2 = private unnamed_addr constant [18 x i16] [i16 104, i16 101, i16 108, i16 108, i16 111, i16 32, i16 8594, i16 32, i16 9731, i16 32, i16 8592, i16 32, i16 119, i16 111, i16 114, i16 108, i16 100, i16 0], section "__TEXT,__ustring", align 2
6*67e74705SXin Li // CHECK-LSB: @.str.4 = private unnamed_addr constant [6 x i16] [i16 116, i16 101, i16 115, i16 116, i16 8482, i16 0], section "__TEXT,__ustring", align 2
7*67e74705SXin Li 
8*67e74705SXin Li 
9*67e74705SXin Li // RUN: %clang_cc1 -triple powerpc-apple-darwin9 -emit-llvm %s -o - | FileCheck -check-prefix CHECK-MSB %s
10*67e74705SXin Li 
11*67e74705SXin Li // CHECK-MSB: @.str = private unnamed_addr constant [8 x i8] c"string0\00"
12*67e74705SXin Li // CHECK-MSB: @.str.1 = private unnamed_addr constant [8 x i8] c"string1\00"
13*67e74705SXin Li // CHECK-MSB: @.str.2 = private unnamed_addr constant [18 x i16] [i16 104, i16 101, i16 108, i16 108, i16 111, i16 32, i16 8594, i16 32, i16 9731, i16 32, i16 8592, i16 32, i16 119, i16 111, i16 114, i16 108, i16 100, i16 0], section "__TEXT,__ustring", align 2
14*67e74705SXin Li // CHECK-MSB: @.str.4 = private unnamed_addr constant [6 x i16] [i16 116, i16 101, i16 115, i16 116, i16 8482, i16 0], section "__TEXT,__ustring", align 2
15*67e74705SXin Li 
16*67e74705SXin Li const char *g0 = "string0";
17*67e74705SXin Li const void *g1 = __builtin___CFStringMakeConstantString("string1");
18*67e74705SXin Li const void *g2 = __builtin___CFStringMakeConstantString("hello \u2192 \u2603 \u2190 world");
19*67e74705SXin Li const void *g3 = __builtin___CFStringMakeConstantString("test™");
20