14967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// REQUIRES: arm-registered-target,x86-registered-target
24967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
34967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple thumbv7-windows -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-COFF
44967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple i686-windows -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-COFF
54967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple x86_64-windows -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-COFF
64967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
74967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple armv7-elf -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-ELF -check-prefix CHECK-ELF32
84967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple i686-elf -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-ELF -check-prefix CHECK-ELF32
94967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple x86_64-elf -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-ELF -check-prefix CHECK-ELF64
104967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple armv7-elf -S %s -o - | FileCheck %s -check-prefix CHECK-ELF-DATA-SECTION
114967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
124967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple armv7-macho -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-MACHO -check-prefix CHECK-MACHO32
134967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple i386-apple-macosx -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-MACHO -check-prefix CHECK-MACHO32
144967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -triple x86_64-macho -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-MACHO -check-prefix CHECK-MACHO64
154967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
164967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainartypedef struct __CFString *CFStringRef;
174967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainarconst CFStringRef one = (CFStringRef)__builtin___CFStringMakeConstantString("one");
184967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainarconst CFStringRef two = (CFStringRef)__builtin___CFStringMakeConstantString("\xef\xbf\xbd\x74\xef\xbf\xbd\x77\xef\xbf\xbd\x6f");
194967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
204967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-COFF: @.str = private unnamed_addr constant [4 x i8] c"one\00", align 1
214967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF: @.str = private unnamed_addr constant [4 x i8] c"one\00", align 1
224967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-MACHO: @.str = private unnamed_addr constant [4 x i8] c"one\00", section "__TEXT,__cstring,cstring_literals", align 1
234967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
244967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-COFF: @_unnamed_cfstring_ = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 3 }, section "cfstring", align {{[48]}}
254967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF32: @_unnamed_cfstring_ = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 3 }, section "cfstring", align 4
264967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF64: @_unnamed_cfstring_ = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 3 }, section "cfstring", align 8
274967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-MACHO32: @_unnamed_cfstring_ = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 3 }, section "__DATA,__cfstring", align 4
284967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-MACHO64: @_unnamed_cfstring_ = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i64 3 }, section "__DATA,__cfstring", align 8
294967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
304967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-COFF: @.str.1 = private unnamed_addr constant [7 x i16] [i16 -3, i16 116, i16 -3, i16 119, i16 -3, i16 111, i16 0], align 2
314967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF: @.str.1 = private unnamed_addr constant [7 x i16] [i16 -3, i16 116, i16 -3, i16 119, i16 -3, i16 111, i16 0], align 2
324967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-MACHO: @.str.1 = private unnamed_addr constant [7 x i16] [i16 -3, i16 116, i16 -3, i16 119, i16 -3, i16 111, i16 0], section "__TEXT,__ustring", align 2
334967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
344967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-COFF: @_unnamed_cfstring_.2 = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([7 x i16]* @.str.1 to i8*), i32 6 }, section "cfstring", align {{[48]}}
354967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF32: @_unnamed_cfstring_.2 = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([7 x i16]* @.str.1 to i8*), i32 6 }, section "cfstring", align 4
364967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF64: @_unnamed_cfstring_.2 = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([7 x i16]* @.str.1 to i8*), i64 6 }, section "cfstring", align 8
374967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-MACHO32: @_unnamed_cfstring_.2 = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([7 x i16]* @.str.1 to i8*), i32 6 }, section "__DATA,__cfstring", align 4
384967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-MACHO64: @_unnamed_cfstring_.2 = private constant %struct.__NSConstantString_tag { i32* getelementptr inbounds ([0 x i32], [0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 2000, i8* bitcast ([7 x i16]* @.str.1 to i8*), i64 6 }, section "__DATA,__cfstring", align 8
394967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
404967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .section .rodata.str1.1
414967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .asciz "one"
424967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
434967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .section .rodata.str2.2
444967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .short 65533
454967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .short 116
464967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .short 65533
474967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .short 119
484967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .short 65533
494967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .short 111
504967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// CHECK-ELF-DATA-SECTION: .short 0
514967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar
52