summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/DebugIR/struct.ll
diff options
context:
space:
mode:
authorDaniel Malea <daniel.malea@intel.com>2013-06-28 20:37:20 +0000
committerDaniel Malea <daniel.malea@intel.com>2013-06-28 20:37:20 +0000
commit4146b0404eab2a98023276bc377a947f1c44efc0 (patch)
treea5b19d64822433d8b2a73b20e86dd3ff00095929 /llvm/test/Transforms/DebugIR/struct.ll
parent3f75953d82307f0406d7be3e78e6ebc1f1273995 (diff)
downloadbcm5719-llvm-4146b0404eab2a98023276bc377a947f1c44efc0.tar.gz
bcm5719-llvm-4146b0404eab2a98023276bc377a947f1c44efc0.zip
Adding tests for DebugIR pass
- lit tests verify that each line of input LLVM IR gets a !dbg node and a corresponding entry of metadata that contains the line number - unit tests verify that DebugIR works as advertised in the interface - refactored some useful IR generation functionality from the MCJIT unit tests so it can be reused llvm-svn: 185212
Diffstat (limited to 'llvm/test/Transforms/DebugIR/struct.ll')
-rw-r--r--llvm/test/Transforms/DebugIR/struct.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Transforms/DebugIR/struct.ll b/llvm/test/Transforms/DebugIR/struct.ll
new file mode 100644
index 00000000000..8db3dbebe90
--- /dev/null
+++ b/llvm/test/Transforms/DebugIR/struct.ll
@@ -0,0 +1,24 @@
+; ModuleID = 'struct.cpp'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-linux-gnu"
+
+%struct.blah = type { i32, float, i8 }
+
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 {
+ %1 = alloca i32, align 4 ; CHECK: !dbg
+ %b = alloca %struct.blah, align 4 ; CHECK-NEXT: !dbg
+ store i32 0, i32* %1 ; CHECK-NEXT: !dbg
+ %2 = getelementptr inbounds %struct.blah* %b, i32 0, i32 0 ; CHECK-NEXT: !dbg
+ %3 = load i32* %2, align 4 ; CHECK-NEXT: !dbg
+ ret i32 %3 ; CHECK-NEXT: !dbg
+}
+
+attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+; CHECK: = metadata !{i32 11,
+; CHECK-NEXT: = metadata !{i32 12,
+; CHECK-NEXT: = metadata !{i32 13,
+; CHECK-NEXT: = metadata !{i32 14,
+
+; RUN: opt %s -debug-ir -S | FileCheck %s
OpenPOWER on IntegriCloud