Switched directories for the test program, added some example LL programs, and gave the Funky programs a temporary extension.
This commit is contained in:
parent
df3bf7c6ab
commit
0ae5a9cee0
4 changed files with 87 additions and 0 deletions
20
test/helloworld.ll
Normal file
20
test/helloworld.ll
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
; Copied directly from the documentation
|
||||
; Declare the string constant as a global constant.
|
||||
@.hello = private unnamed_addr constant [13 x i8] c"hello world\0A\00"
|
||||
|
||||
; External declaration of the puts function
|
||||
declare i32 @puts(i8* nocapture) nounwind
|
||||
|
||||
; Definition of main function
|
||||
define i32 @main() { ; i32()*
|
||||
; Convert [13 x i8]* to i8 *...
|
||||
%cast210 = getelementptr [13 x i8],[13 x i8]* @.hello, i64 0, i64 0
|
||||
|
||||
; Call puts function to write out the string to stdout.
|
||||
call i32 @puts(i8* %cast210)
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
; Named metadata
|
||||
!0 = !{i32 42, null, !"string"}
|
||||
!foo = !{!0}
|
||||
Loading…
Add table
Add a link
Reference in a new issue