This reverts commit d618f1c3b12effd0c2bdb7d02108d3551f389d3d. This commit wasn't reviewed ahead of time and significant concerns were raised immediately after it landed. According to our developer policy this warrants immediate revert of the commit. https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy Differential Revision: https://reviews.llvm.org/D155509
26 lines
919 B
C
26 lines
919 B
C
// REQUIRES: x86-registered-target
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-macho -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 -triple x86_64-macho -fwritable-strings -emit-llvm %s -o - | FileCheck %s
|
|
//
|
|
// CHECK: @.str = private unnamed_addr constant [14 x i8] c"Hello, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
|
|
// 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
|
|
|
|
#define CFSTR __builtin___CFStringMakeConstantString
|
|
|
|
void f(void) {
|
|
CFSTR("Hello, World!");
|
|
}
|
|
|
|
// rdar://6248329
|
|
void *G = CFSTR("yo joe");
|
|
|
|
void h(void) {
|
|
static void* h = CFSTR("Goodbye, World!");
|
|
}
|