1 # RUN: llc -run-pass=ppc-merge-strings -mcpu=pwr8 -mtriple powerpc64le-unknown-linux-gnu \
2 # RUN: -verify-machineinstrs -o - %s | FileCheck %s
3 # RUN: llc -run-pass=ppc-merge-strings -mcpu=pwr8 -mtriple powerpc64-ibm-aix-xcoff \
4 # RUN: -verify-machineinstrs -o - %s | FileCheck %s
8 @const.1 = internal constant [7 x i8] c"const1\00", align 1
9 @const.2 = internal constant [7 x i8] c"const2\00", align 1
12 ;; Start of test code.
15 define noundef ptr @func1(ptr noundef nonnull align 8 dereferenceable(8) %this) #0 !dbg !6 {
17 ; CHECK: ret ptr getelementptr inbounds ({ [7 x i8], [7 x i8] }, ptr @__ModuleStringPool, i32 0, i32 1), !dbg !14
19 ret ptr @const.2, !dbg !14
22 define noundef ptr @func2(ptr noundef nonnull align 8 dereferenceable(8) %this) #0 {
24 ; CHECK: ret ptr @__ModuleStringPool
29 attributes #0 = { noinline nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="pwr8" "target-features"="+altivec,+bpermd,+crbits,+crypto,+direct-move,+extdiv,+htm,+isa-v206-instructions,+isa-v207-instructions,+power8-vector,+quadword-atomics,+vsx,-aix-small-local-exec-tls,-isa-v30-instructions,-power9-vector,-privileged,-rop-protect,-spe" }
32 !llvm.module.flags = !{!3, !4}
35 ; CHECK: !10 = !DITemplateValueParameter(name: "ID", type: !11, value: ptr getelementptr inbounds ({ [7 x i8], [7 x i8] }, ptr @__ModuleStringPool, i32 0, i32 1))
36 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
37 !1 = !DIFile(filename: "constant-pointers.cpp", directory: "/tmp/dbginfo")
39 !3 = !{i32 7, !"Dwarf Version", i32 3}
40 !4 = !{i32 2, !"Debug Info Version", i32 3}
41 !5 = !{!"clang version 17.0.0"}
42 !6 = distinct !DISubprogram(name: "getId", linkageName: "func1", scope: !1, file: !1, line: 2, type: !7, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, templateParams: !9, retainedNodes: !2)
43 !7 = !DISubroutineType(types: !8)
46 !10 = !DITemplateValueParameter(name: "ID", type: !11, value: ptr @const.2)
47 !11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64)
48 !12 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !13)
49 !13 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_unsigned_char)
50 !14 = !DILocation(line: 3, scope: !6)