Index: test/Transforms/NaCl/simplify-allocas.ll |
diff --git a/test/Transforms/NaCl/simplify-allocas.ll b/test/Transforms/NaCl/simplify-allocas.ll |
index 27724e91d65bc4e47ef4e66acf1d4ac0d6044045..b412b29fcf7fb7f879fd0f60f21d5ac22ed7555c 100644 |
--- a/test/Transforms/NaCl/simplify-allocas.ll |
+++ b/test/Transforms/NaCl/simplify-allocas.ll |
@@ -138,31 +138,46 @@ define void @dyn_inst_alloca_array_zext(i8 %a) { |
declare void @llvm.dbg.declare(metadata, metadata, metadata) |
define void @debug_declare() { |
%var = alloca i32 |
- call void @llvm.dbg.declare(metadata i32* %var, metadata !11, metadata !12), !dbg !13 |
+ call void @llvm.dbg.declare(metadata i32* %var, metadata !12, metadata !13), !dbg !14 |
unreachable |
} |
; Ensure that the first arg to dbg.declare points to the alloca, not the bitcast |
; CHECK-LABEL: define void @debug_declare |
; CHECK-NEXT: %var = alloca i8, i32 4 |
-; CHECK: call void @llvm.dbg.declare(metadata i8* %var, metadata !11, metadata !12), !dbg !13 |
+; CHECK: call void @llvm.dbg.declare(metadata i8* %var, metadata !12, metadata !13), !dbg !14 |
+ |
+define void @debug_declare_morecasts() { |
+ %var = alloca i32, i32 2, align 8 |
+ %other_bc = bitcast i32* %var to i64* |
+ %other_bc2 = bitcast i64* %other_bc to i16* |
+ call void @llvm.dbg.declare(metadata i16* %other_bc2, metadata !15, metadata !13), !dbg !16 |
+ unreachable |
+} |
+; Ensure that the first arg to dbg.declare points to the alloca, not bitcasts |
+; CHECK-LABEL: define void @debug_declare_morecasts |
+; CHECK-NEXT: %var = alloca i8, i32 8, align 8 |
+; CHECK: call void @llvm.dbg.declare(metadata i8* %var, metadata !15, metadata !13), !dbg !16 |
!llvm.dbg.cu = !{!0} |
-!llvm.module.flags = !{!8, !9} |
-!llvm.ident = !{!10} |
+!llvm.module.flags = !{!9, !10} |
+!llvm.ident = !{!11} |
; CHECK: !4 = !MDSubprogram(name: "debug_declare", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @debug_declare, variables: !2) |
!0 = !MDCompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 235150) (llvm/trunk 235152)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
!1 = !MDFile(filename: "foo.c", directory: "/s/llvm/cmakebuild") |
!2 = !{} |
-!3 = !{!4} |
+!3 = !{!4, !8} |
!4 = !MDSubprogram(name: "debug_declare", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @debug_declare, variables: !2) |
!5 = !MDSubroutineType(types: !6) |
!6 = !{null, !7} |
!7 = !MDBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
-!8 = !{i32 2, !"Dwarf Version", i32 4} |
-!9 = !{i32 2, !"Debug Info Version", i32 3} |
-!10 = !{!"clang version 3.7.0 (trunk 235150) (llvm/trunk 235152)"} |
-!11 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", arg: 1, scope: !4, file: !1, line: 1, type: !7) |
-!12 = !MDExpression() |
-!13 = !MDLocation(line: 1, column: 24, scope: !4) |
+!8 = !MDSubprogram(name: "debug_declare_morecasts", scope: !1, file: !1, line: 8, type: !5, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @debug_declare_morecasts, variables: !2) |
+!9 = !{i32 2, !"Dwarf Version", i32 4} |
+!10 = !{i32 2, !"Debug Info Version", i32 3} |
+!11 = !{!"clang version 3.7.0 (trunk 235150) (llvm/trunk 235152)"} |
+!12 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "val", arg: 1, scope: !4, file: !1, line: 1, type: !7) |
+!13 = !MDExpression() |
+!14 = !MDLocation(line: 1, column: 24, scope: !4) |
+!15 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "var", arg: 1, scope: !8, file: !1, line: 9, type: !7) |
+!16 = !MDLocation(line: 9, column: 24, scope: !8) |