blob: 9d98b56e6b843296c5faf43d38d62e20c1986dbb [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -emit-llvm %s -o %t
Bill Wendling1bf7a3f2012-01-10 08:46:39 +00002
3// <rdar://problem/10657500>: Check that the backing store of CFStrings are
4// constant with the -fwritable-strings flag.
5//
6// RUN: %clang_cc1 -fwritable-strings -emit-llvm %s -o - | FileCheck %s
7//
8// CHECK: @.str = linker_private unnamed_addr constant [14 x i8] c"Hello, World!\00", align 1
9// CHECK: @.str1 = linker_private unnamed_addr constant [7 x i8] c"yo joe\00", align 1
10// CHECK: @.str3 = linker_private unnamed_addr constant [16 x i8] c"Goodbye, World!\00", align 1
11
Anders Carlssonf06273f2007-11-19 00:25:30 +000012#define CFSTR __builtin___CFStringMakeConstantString
13
14void f() {
15 CFSTR("Hello, World!");
Daniel Dunbar2d6ca8d2008-08-21 02:51:29 +000016}
Chris Lattner506ff882008-10-06 07:26:43 +000017
18// rdar://6248329
19void *G = CFSTR("yo joe");
20
Eli Friedman3941b182009-01-25 01:54:01 +000021void h() {
22 static void* h = CFSTR("Goodbye, World!");
23}