[llvm] r234815 - [Orc] Make the OrcLazy hello.ll regression test output via stderr.
Lang Hames
lhames at gmail.com
Mon Apr 13 16:28:47 PDT 2015
Author: lhames
Date: Mon Apr 13 18:28:46 2015
New Revision: 234815
URL: http://llvm.org/viewvc/llvm-project?rev=234815&view=rev
Log:
[Orc] Make the OrcLazy hello.ll regression test output via stderr.
This keeps the program and JIT output in sync, enabling FileCheck to test the
order of target program and JIT events.
In particular we can now test that main is not compiled until after the global
constructor has run.
Modified:
llvm/trunk/test/ExecutionEngine/OrcLazy/hello.ll
Modified: llvm/trunk/test/ExecutionEngine/OrcLazy/hello.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/OrcLazy/hello.ll?rev=234815&r1=234814&r2=234815&view=diff
==============================================================================
--- llvm/trunk/test/ExecutionEngine/OrcLazy/hello.ll (original)
+++ llvm/trunk/test/ExecutionEngine/OrcLazy/hello.ll Mon Apr 13 18:28:46 2015
@@ -1,34 +1,47 @@
-; RUN: lli -jit-kind=orc-lazy %s | FileCheck %s
+; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stderr %s 2>&1 | FileCheck %s
;
; CHECK: Hello
-; CHECK-NEXT: Goodbye
+; CHECK: [ main$orc_body ]
+; CHECK: Goodbye
%class.Foo = type { i8 }
+%struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
+%struct.__sFILEX = type opaque
+%struct.__sbuf = type { i8*, i32 }
@f = global %class.Foo zeroinitializer, align 1
@__dso_handle = external global i8
+ at __stderrp = external global %struct.__sFILE*
+ at .str = private unnamed_addr constant [7 x i8] c"Hello\0A\00", align 1
+ at .str1 = private unnamed_addr constant [9 x i8] c"Goodbye\0A\00", align 1
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_hello.cpp, i8* null }]
- at str = private unnamed_addr constant [6 x i8] c"Hello\00"
- at str2 = private unnamed_addr constant [8 x i8] c"Goodbye\00"
-define linkonce_odr void @_ZN3FooD1Ev(%class.Foo* nocapture readnone %this) unnamed_addr align 2 {
+define internal void @_GLOBAL__sub_I_hello.cpp() section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
- %puts.i = tail call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str2, i64 0, i64 0))
+ call void @_ZN3FooC1Ev(%class.Foo* @f)
+ %0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%class.Foo*)* @_ZN3FooD1Ev to void (i8*)*), i8* getelementptr inbounds (%class.Foo, %class.Foo* @f, i32 0, i32 0), i8* @__dso_handle)
ret void
}
-declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
-
-define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
+define linkonce_odr void @_ZN3FooC1Ev(%class.Foo* %this) unnamed_addr align 2 {
entry:
- ret i32 0
+ %0 = load %struct.__sFILE*, %struct.__sFILE** @__stderrp, align 8
+ %call.i = call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0))
+ ret void
}
-define internal void @_GLOBAL__sub_I_hello.cpp() {
+define linkonce_odr void @_ZN3FooD1Ev(%class.Foo* %this) unnamed_addr align 2 {
entry:
- %puts.i.i.i = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
- %0 = tail call i32 @__cxa_atexit(void (i8*)* bitcast (void (%class.Foo*)* @_ZN3FooD1Ev to void (i8*)*), i8* getelementptr inbounds (%class.Foo, %class.Foo* @f, i64 0, i32 0), i8* @__dso_handle)
+ %0 = load %struct.__sFILE*, %struct.__sFILE** @__stderrp, align 8
+ %call.i = call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i32 0, i32 0))
ret void
}
-declare i32 @puts(i8* nocapture readonly)
+
+define i32 @main(i32 %argc, i8** %argv) {
+entry:
+ ret i32 0
+}
+
+declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
+declare i32 @fprintf(%struct.__sFILE*, i8*, ...)
More information about the llvm-commits
mailing list