| OLD | NEW |
| (Empty) | |
| 1 ;; For now, we are using a .ll file as a "pexe". This is only a bad pexe |
| 2 ;; in the sense that it shouldn't compile (missing instruction), |
| 3 ;; not that it will crash LLC. Eventually we should make this into |
| 4 ;; a bitcode file w/ the proper pexe metadata. |
| 5 |
| 6 ;; To actually crash LLC (and do so reliably), perhaps we could add |
| 7 ;; an SRPC method to LLC to ask it to crash itself. |
| 8 ;; That seems much more reliable than trying to find a bitcode file that |
| 9 ;; for version X will crash LLC, but for version Y it has been fixed. |
| 10 |
| 11 @.str = private unnamed_addr constant [12 x i8] c"Hello world\00", align 4 |
| 12 |
| 13 define i32 @main(i32 %argc, i8** %argv) nounwind { |
| 14 entry: |
| 15 %argc_addr = alloca i32, align 4 |
| 16 %argv_addr = alloca i8**, align 4 |
| 17 %retval = alloca i32 |
| 18 %0 = alloca i32 |
| 19 %"alloca point" = bitcast i32 0 to i32 |
| 20 store i32 %argc, i32* %argc_addr |
| 21 store i8** %argv, i8*** %argv_addr |
| 22 %1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0
)) nounwind |
| 23 store i32 0, i32* %0, align 4 |
| 24 |
| 25 ;; Intentionally comment this line out to make it fail to compile. |
| 26 ;; %2 = load i32* %0, align 4 |
| 27 |
| 28 store i32 %2, i32* %retval, align 4 |
| 29 br label %return |
| 30 |
| 31 return: ; preds = %entry |
| 32 %retval1 = load i32* %retval |
| 33 ret i32 %retval1 |
| 34 } |
| 35 |
| 36 declare i32 @puts(i8*) |
| OLD | NEW |