diff --git a/llvm/test/Other/print-dot-dag.ll b/llvm/test/Other/print-dot-dag.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Other/print-dot-dag.ll @@ -0,0 +1,62 @@ +; RUN: llc -fast-isel=false -view-sched-dags < %s 2>&1 > /dev/null +; RUN: FileCheck %s -input-file=main:entry.dot + +; Test the dot graph printer for a SelectionDAG graph generated from +; the following test case. +; +; int main() { +; int a, b, c; +; c = a + b; +; return 0; +; } + +; CHECK: digraph "scheduler input for main:entry" +; CHECK-NEXT: rankdir="BT"; +; CHECK-NEXT: label="scheduler input for main:entry"; +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{EntryToken|t0|{ch}}"]; +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{MOV32r0|t1|{i32|i32}}"]; +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{TargetConstant\<0\>|t14|{i32}}"]; +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{Register $eax|t15|{i32}}"]; +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{{0|1|2|3|4|5|6}|MOV32mi\|t5|{ch}}"]; +; CHECK-COUNT-7: {{Node0x.*}} -> {{Node0x.*}} +; CHECK-NEXT: {{Node0x.*}} -> {{Node0x.*}}[color=blue,style=dashed] +; CHECK: {{Node0x.*}} [shape=record,shape=Mrecord,label="{TargetFrameIndex\<3\>|t18|{i64}}"] +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{TargetConstant\<1\>|t19|{i8}}"] +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{Register $noreg|t20|{i64}}"] +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{Register $noreg|t21|{i16}}"] +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{Register $noreg|t22|{i32}}"] +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{TargetFrameIndex\<1\>|t23|{i64}}"] +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{TargetFrameIndex\<2\>|t24|{i64}}"] +; CHECK-NEXT: {{Node0x.*}} [shape=record,shape=Mrecord,label="{TargetFrameIndex\<0\>|t25|{i64}}"] +; CHECK-NEXT: {{Node0x.*}}[ plaintext=circle, label ="GraphRoot"] +; CHECK-NEXT: {{Node0x}} -> {{Node0x.*}}[color=blue,style=dashed] + +; ModuleID = 'print-dot-dag.c' +source_filename = "print-dot-dag.c" +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +; Function Attrs: noinline nounwind optnone uwtable +define dso_local i32 @main() #0 { +entry: + %retval = alloca i32, align 4 + %a = alloca i32, align 4 + %b = alloca i32, align 4 + %c = alloca i32, align 4 + store i32 0, i32* %retval, align 4 + %0 = load i32, i32* %a, align 4 + %1 = load i32, i32* %b, align 4 + %add = add nsw i32 %0, %1 + store i32 %add, i32* %c, align 4 + ret i32 0 +} + +attributes #0 = { noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } + +!llvm.module.flags = !{!0, !1, !2} +!llvm.ident = !{!3} + +!0 = !{i32 1, !"wchar_size", i32 4} +!1 = !{i32 7, !"uwtable", i32 1} +!2 = !{i32 7, !"frame-pointer", i32 2} +!3 = !{!"clang version 14.0.0 (https://github.com/llvm/llvm-project.git 36b0325c442a3669c2eb2c6fcaeb2cb57445c851)"}