blob: 21e87cac9e5a72b7303393026dc0c7248be95256 [file] [log] [blame]
Reid Spencer0f1725e2006-12-03 16:17:19 +00001; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc
Tanya Lattner2acf9b02004-11-06 23:32:43 +00002; RUN: lli %t.bc > /dev/null
3
John Criswell42c6d592003-08-21 21:18:21 +00004;
5; Regression Test: EnvironmentTest.ll
6;
7; Description:
8; This is a regression test that verifies that the JIT passes the
9; environment to the main() function.
10;
11
Chris Lattner746f8042003-08-21 21:33:19 +000012implementation
John Criswell42c6d592003-08-21 21:18:21 +000013
14declare uint %strlen(sbyte*)
15
John Criswell42c6d592003-08-21 21:18:21 +000016int %main(int %argc.1, sbyte** %argv.1, sbyte** %envp.1) {
Chris Lattnerff675bf2003-11-19 19:42:12 +000017 %tmp.2 = load sbyte** %envp.1
18 %tmp.3 = call uint %strlen( sbyte* %tmp.2 )
Chris Lattner746f8042003-08-21 21:33:19 +000019 %T = seteq uint %tmp.3, 0
20 %R = cast bool %T to int
21 ret int %R
John Criswell42c6d592003-08-21 21:18:21 +000022}
23