2016-05-31 00:36:48 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
|
|
|
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-macho -emit-llvm %s -o %t
|
2012-01-10 16:46:39 +08:00
|
|
|
|
|
|
|
// <rdar://problem/10657500>: Check that the backing store of CFStrings are
|
|
|
|
// constant with the -fwritable-strings flag.
|
|
|
|
//
|
2016-05-31 00:36:48 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-macho -fwritable-strings -emit-llvm %s -o - | FileCheck %s
|
2012-01-10 16:46:39 +08:00
|
|
|
//
|
2014-01-21 09:50:12 +08:00
|
|
|
// CHECK: @.str = private unnamed_addr constant [14 x i8] c"Hello, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
|
2015-05-13 00:48:43 +08:00
|
|
|
// CHECK: @.str.1 = private unnamed_addr constant [7 x i8] c"yo joe\00", section "__TEXT,__cstring,cstring_literals", align 1
|
|
|
|
// CHECK: @.str.3 = private unnamed_addr constant [16 x i8] c"Goodbye, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
|
2012-01-10 16:46:39 +08:00
|
|
|
|
2007-11-19 08:25:30 +08:00
|
|
|
#define CFSTR __builtin___CFStringMakeConstantString
|
|
|
|
|
|
|
|
void f() {
|
|
|
|
CFSTR("Hello, World!");
|
2008-08-21 10:51:29 +08:00
|
|
|
}
|
2008-10-06 15:26:43 +08:00
|
|
|
|
|
|
|
// rdar://6248329
|
|
|
|
void *G = CFSTR("yo joe");
|
|
|
|
|
2009-01-25 09:54:01 +08:00
|
|
|
void h() {
|
|
|
|
static void* h = CFSTR("Goodbye, World!");
|
|
|
|
}
|