Tanya Lattner | e9789ef | 2004-11-06 23:32:43 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as -f %s -o %t.bc |
| 2 | ; RUN: lli %t.bc > /dev/null |
| 3 | |
John Criswell | 59da488 | 2003-08-21 21:18:21 +0000 | [diff] [blame] | 4 | ; |
| 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 Lattner | 11a7fd1 | 2003-08-21 21:33:19 +0000 | [diff] [blame] | 12 | implementation |
John Criswell | 59da488 | 2003-08-21 21:18:21 +0000 | [diff] [blame] | 13 | |
| 14 | declare uint %strlen(sbyte*) |
| 15 | |
John Criswell | 59da488 | 2003-08-21 21:18:21 +0000 | [diff] [blame] | 16 | int %main(int %argc.1, sbyte** %argv.1, sbyte** %envp.1) { |
Chris Lattner | 639b052 | 2003-11-19 19:42:12 +0000 | [diff] [blame] | 17 | %tmp.2 = load sbyte** %envp.1 |
| 18 | %tmp.3 = call uint %strlen( sbyte* %tmp.2 ) |
Chris Lattner | 11a7fd1 | 2003-08-21 21:33:19 +0000 | [diff] [blame] | 19 | %T = seteq uint %tmp.3, 0 |
| 20 | %R = cast bool %T to int |
| 21 | ret int %R |
John Criswell | 59da488 | 2003-08-21 21:18:21 +0000 | [diff] [blame] | 22 | } |
| 23 | |