1 | // REQUIRES: x86-registered-target |
2 | |
3 | // RUN: %clang_cc1 -triple x86_64-elf -DCF_BUILDING_CF -DDECL -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF-IN-CF-DECL |
4 | // RUN: %clang_cc1 -triple x86_64-elf -DCF_BUILDING_CF -DDEFN -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF-IN-CF-DEFN |
5 | // RUN: %clang_cc1 -triple x86_64-elf -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF |
6 | // RUN: %clang_cc1 -triple x86_64-elf -DEXTERN -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF-EXTERN |
7 | |
8 | // RUN: %clang_cc1 -Os -triple x86_64-elf -DCF_BUILDING_CF -DDECL -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF-IN-CF-DECL |
9 | // RUN: %clang_cc1 -Os -triple x86_64-elf -DCF_BUILDING_CF -DDEFN -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF-IN-CF-DEFN |
10 | // RUN: %clang_cc1 -Os -triple x86_64-elf -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF |
11 | // RUN: %clang_cc1 -Os -triple x86_64-elf -DEXTERN -S -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-CF-EXTERN |
12 | |
13 | |
14 | #if defined(CF_BUILDING_CF) |
15 | #if defined(DECL) |
16 | extern long __CFConstantStringClassReference[]; |
17 | #elif defined(DEFN) |
18 | long __CFConstantStringClassReference[32]; |
19 | #endif |
20 | #else |
21 | #if defined(EXTERN) |
22 | extern long __CFConstantStringClassReference[]; |
23 | #else |
24 | long __CFConstantStringClassReference[]; |
25 | #endif |
26 | #endif |
27 | |
28 | typedef struct __CFString *CFStringRef; |
29 | const CFStringRef string = (CFStringRef)__builtin___CFStringMakeConstantString("string"); |
30 | |
31 | |
32 | // CHECK-CF-IN-CF-DECL: @__CFConstantStringClassReference = external global [0 x i32] |
33 | // CHECK-CF-IN-CF-DEFN: @__CFConstantStringClassReference = common global [32 x i64] zeroinitializer, align 16 |
34 | // CHECK-CF: @__CFConstantStringClassReference = common global [1 x i64] zeroinitializer, align 8 |
35 | // CHECK-CF-EXTERN: @__CFConstantStringClassReference = external global [0 x i32] |
36 | // CHECK-CF-EXTERN: @.str = private unnamed_addr constant [7 x i8] c"string\00", section ".rodata", align 1 |
37 | |