• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
2; Test all the cases where a L label is safe. Removing any entry from
3; TargetLoweringObjectFileMachO::isSectionAtomizableBySymbols should cause
4; this to fail.
5; We also test some noteworthy cases that require an l label.
6
7@private1 = private unnamed_addr constant [4 x i8] c"zed\00"
8; CHECK: .section	__TEXT,__cstring,cstring_literals
9; CHECK-NEXT: L_private1:
10
11@private2 = private unnamed_addr constant [5 x i16] [i16 116, i16 101,
12                                                     i16 115, i16 116, i16 0]
13; CHECK: .section	__TEXT,__ustring
14; CHECK-NEXT: .p2align	1
15; CHECK-NEXT: l_private2:
16
17; There is no dedicated 4 byte strings on MachO.
18
19%struct.NSConstantString = type { i32*, i32, i8*, i32 }
20@private3 = private constant %struct.NSConstantString { i32* null, i32 1992, i8* null, i32 0 }, section "__DATA,__cfstring"
21; CHECK: .section	__DATA,__cfstring
22; CHECK-NEXT: .p2align	4
23; CHECK-NEXT: L_private3:
24
25; There is no dedicated 1 or 2 byte constant section on MachO.
26
27@private4 = private unnamed_addr constant i32 42
28; CHECK: .section	__TEXT,__literal4,4byte_literals
29; CHECK-NEXT: .p2align	2
30; CHECK-NEXT: L_private4:
31
32@private5 = private unnamed_addr constant i64 42
33; CHECK: .section	__TEXT,__literal8,8byte_literals
34; CHECK-NEXT: .p2align	3
35; CHECK-NEXT: L_private5:
36
37@private6 = private unnamed_addr constant i128 42
38; CHECK: .section	__TEXT,__literal16,16byte_literals
39; CHECK-NEXT: .p2align	3
40; CHECK-NEXT: L_private6:
41
42%struct._objc_class = type { i8* }
43@private7 = private global %struct._objc_class* null, section "__OBJC,__cls_refs,literal_pointers,no_dead_strip"
44; CHECK: .section	__OBJC,__cls_refs,literal_pointers,no_dead_strip
45; CHECK: .p2align	3
46; CHECK: L_private7:
47
48@private8 = private global i32* null, section "__DATA,__nl_symbol_ptr,non_lazy_symbol_pointers"
49; CHECK: .section	__DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
50; CHECK-NEXT: .p2align	3
51; CHECK-NEXT: L_private8:
52
53@private9 = private global i32* null, section "__DATA,__la_symbol_ptr,lazy_symbol_pointers"
54; CHECK: .section	__DATA,__la_symbol_ptr,lazy_symbol_pointers
55; CHECK-NEXT: .p2align	3
56; CHECK-NEXT: L_private9:
57
58@private10 = private global i32* null, section "__DATA,__mod_init_func,mod_init_funcs"
59; CHECK: .section	__DATA,__mod_init_func,mod_init_funcs
60; CHECK-NEXT: .p2align	3
61; CHECK-NEXT: L_private10:
62
63@private11 = private global i32* null, section "__DATA,__mod_term_func,mod_term_funcs"
64; CHECK: .section	__DATA,__mod_term_func,mod_term_funcs
65; CHECK-NEXT: .p2align	3
66; CHECK-NEXT: L_private11:
67
68@private12 = private global i32* null, section "__DATA,__foobar,interposing"
69; CHECK: .section	__DATA,__foobar,interposing
70; CHECK-NEXT: .p2align	3
71; CHECK-NEXT: L_private12:
72
73@private13 = private global i32 42, section "__DATA, __objc_classlist, regular, no_dead_strip"
74; CHECK: .section	__DATA,__objc_classlist,regular,no_dead_strip
75; CHECK-NEXT: .p2align	2
76; CHECK-NEXT: L_private13:
77
78@private14 = private global [4 x i8] c"zed\00", section "__TEXT,__objc_classname,cstring_literals"
79; CHECK: .section	__TEXT,__objc_classname,cstring_literals
80; CHECK-NEXT: L_private14:
81
82@private15 = private global [4 x i8] c"zed\00", section "__TEXT,__objc_methname,cstring_literals"
83; CHECK: .section	__TEXT,__objc_methname,cstring_literals
84; CHECK-NEXT: L_private15:
85
86@private16 = private global [4 x i8] c"zed\00", section "__TEXT,__objc_methtype,cstring_literals"
87; CHECK: .section	__TEXT,__objc_methtype,cstring_literals
88; CHECK-NEXT: L_private16:
89