aboutsummaryrefslogtreecommitdiffstats
path: root/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/ExecutionEngine/2003-08-21-EnvironmentTest.ll')
-rw-r--r--test/ExecutionEngine/2003-08-21-EnvironmentTest.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll b/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
new file mode 100644
index 0000000..21e87ca
--- /dev/null
+++ b/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
@@ -0,0 +1,23 @@
+; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc
+; RUN: lli %t.bc > /dev/null
+
+;
+; Regression Test: EnvironmentTest.ll
+;
+; Description:
+; This is a regression test that verifies that the JIT passes the
+; environment to the main() function.
+;
+
+implementation
+
+declare uint %strlen(sbyte*)
+
+int %main(int %argc.1, sbyte** %argv.1, sbyte** %envp.1) {
+ %tmp.2 = load sbyte** %envp.1
+ %tmp.3 = call uint %strlen( sbyte* %tmp.2 )
+ %T = seteq uint %tmp.3, 0
+ %R = cast bool %T to int
+ ret int %R
+}
+