From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGen/cfstring.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/CodeGen/cfstring.c (limited to 'clang/test/CodeGen/cfstring.c') diff --git a/clang/test/CodeGen/cfstring.c b/clang/test/CodeGen/cfstring.c new file mode 100644 index 0000000..9d98b56 --- /dev/null +++ b/clang/test/CodeGen/cfstring.c @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -emit-llvm %s -o %t + +// : 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!"); +} -- cgit v1.2.3