1 ; RUN: opt %s -passes='sroa,early-cse' -S | FileCheck %s
2 ; CHECK: DIExpression(DW_OP_constu, 9223372036854775808, DW_OP_minus, DW_OP_stack_value)
3 ; Created from the following C input (and then delta-reduced the IR):
5 ; extern unsigned long long use(unsigned long long);
6 ; void f(unsigned long long x) {
7 ; for (; x > 0; x --) {
8 ; unsigned long long y = x + 0x8000000000000000;
13 define void @f(i64 noundef %x) #0 !dbg !9 {
15 %x.addr = alloca i64, align 8
16 %y = alloca i64, align 8
18 for.cond: ; preds = %for.inc, %entry
19 %0 = load i64, ptr %x.addr, align 8
20 call void @llvm.dbg.declare(metadata ptr %y, metadata !15, metadata !DIExpression())
22 %1 = load i64, ptr %x.addr, align 8
23 %add = add i64 %1, -9223372036854775808
24 store i64 %add, ptr %y, align 8
27 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
29 !llvm.module.flags = !{!3,!7}
31 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None, sysroot: "/")
32 !1 = !DIFile(filename: "t.c", directory: "/")
33 !3 = !{i32 2, !"Debug Info Version", i32 3}
34 !7 = !{i32 7, !"frame-pointer", i32 2}
35 !9 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !10, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !13)
36 !10 = !DISubroutineType(types: !11)
38 !12 = !DIBasicType(name: "unsigned long long", size: 64, encoding: DW_ATE_unsigned)
40 !15 = !DILocalVariable(name: "y", scope: !16, file: !1, line: 4, type: !12)
41 !16 = distinct !DILexicalBlock(scope: !17, file: !1, line: 3, column: 23)
42 !17 = distinct !DILexicalBlock(scope: !18, file: !1, line: 3, column: 3)
43 !18 = distinct !DILexicalBlock(scope: !9, file: !1, line: 3, column: 3)
44 !29 = !DILocation(line: 4, column: 24, scope: !16)