[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / cfstring.c
blobf7c90f77b062ea25c6a918a11db666cb7fbe24d3
1 // REQUIRES: x86-registered-target
3 // RUN: %clang_cc1 -triple x86_64-macho -emit-llvm %s -o %t
5 // <rdar://problem/10657500>: Check that the backing store of CFStrings are
6 // constant with the -fwritable-strings flag.
7 //
8 // RUN: %clang_cc1 -triple x86_64-macho -fwritable-strings -emit-llvm %s -o - | FileCheck %s
9 //
10 // CHECK: @.str = private unnamed_addr constant [14 x i8] c"Hello, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
11 // CHECK: @.str.1 = private unnamed_addr constant [7 x i8] c"yo joe\00", section "__TEXT,__cstring,cstring_literals", align 1
12 // CHECK: @.str.3 = private unnamed_addr constant [16 x i8] c"Goodbye, World!\00", section "__TEXT,__cstring,cstring_literals", align 1
14 #define CFSTR __builtin___CFStringMakeConstantString
16 void f(void) {
17 CFSTR("Hello, World!");
20 // rdar://6248329
21 void *G = CFSTR("yo joe");
23 void h(void) {
24 static void* h = CFSTR("Goodbye, World!");