summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/cfstring.c
blob: 9d98b56e6b843296c5faf43d38d62e20c1986dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %clang_cc1 -emit-llvm %s -o %t

// <rdar://problem/10657500>: Check that the backing store of CFStrings are
// constant with the -fwritable-strings flag.
//
// RUN: %clang_cc1 -fwritable-strings -emit-llvm %s -o - | FileCheck %s
//
// CHECK: @.str = linker_private unnamed_addr constant [14 x i8] c"Hello, World!\00", align 1
// CHECK: @.str1 = linker_private unnamed_addr constant [7 x i8] c"yo joe\00", align 1
// CHECK: @.str3 = linker_private unnamed_addr constant [16 x i8] c"Goodbye, World!\00", align 1

#define CFSTR __builtin___CFStringMakeConstantString

void f() {
  CFSTR("Hello, World!");
}

// rdar://6248329
void *G = CFSTR("yo joe");

void h() {
  static void* h = CFSTR("Goodbye, World!");
}