1; RUN: llc -relocation-model=static -arm-promote-constant < %s | FileCheck %s
2
3target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
4target triple = "thumbv7m--linux-gnu"
5
6@.str = private unnamed_addr constant [4 x i8] c"abc\00", align 1
7
8; CHECK-LABEL: fn1
9; CHECK: .str:
10define arm_aapcscc i8* @fn1() local_unnamed_addr #0 !dbg !8 {
11entry:
12  ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), !dbg !14
13}
14
15; CHECK-LABEL: fn2
16; CHECK-NOT: .str:
17define arm_aapcscc i8* @fn2() local_unnamed_addr #0 !dbg !15 {
18entry:
19  ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 1), !dbg !16
20}
21
22attributes #0 = { minsize norecurse nounwind optsize readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="cortex-m3" "target-features"="+hwdiv,+soft-float,-crypto,-neon" "unsafe-fp-math"="false" "use-soft-float"="true" }
23
24!llvm.dbg.cu = !{!0}
25!llvm.module.flags = !{!3, !4, !5, !6}
26!llvm.ident = !{!7}
27
28!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.9.0 (http://llvm.org/git/clang.git 075a2bc2570dfcbb6d6aed6c836e4c62b37afea6)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
29!1 = !DIFile(filename: "/Users/jammol01/Code/test.c", directory: "/Users/jammol01/Code/llvm-git/build")
30!2 = !{}
31!3 = !{i32 2, !"Dwarf Version", i32 4}
32!4 = !{i32 2, !"Debug Info Version", i32 3}
33!5 = !{i32 1, !"wchar_size", i32 4}
34!6 = !{i32 1, !"min_enum_size", i32 4}
35!7 = !{!"clang version 3.9.0 (http://llvm.org/git/clang.git 075a2bc2570dfcbb6d6aed6c836e4c62b37afea6)"}
36!8 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !2)
37!9 = !DISubroutineType(types: !10)
38!10 = !{!11}
39!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 32, align: 32)
40!12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13)
41!13 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_unsigned_char)
42!14 = !DILocation(line: 2, column: 5, scope: !8)
43!15 = distinct !DISubprogram(name: "fn2", scope: !1, file: !1, line: 4, type: !9, isLocal: false, isDefinition: true, scopeLine: 4, isOptimized: true, unit: !0, retainedNodes: !2)
44!16 = !DILocation(line: 5, column: 5, scope: !15)
45