Skip to content

Instantly share code, notes, and snippets.

@fables-tales
Created July 22, 2010 11:40
Show Gist options
  • Save fables-tales/485870 to your computer and use it in GitHub Desktop.
Save fables-tales/485870 to your computer and use it in GitHub Desktop.
define i32 @main()
{
;create location and store it
%location = alloca i32
store i32 0, i32* %location
@values = internal global [8192 x i32] zeroinitializer
%shouldbezero = getelementptr @values, i32 0
ret i32 0;
}
@fables-tales
Copy link
Author

@values = internal global [8192 x i32] zeroinitializer

define i32 @main()
{
entry:
;create location and store zero to it
%location = alloca i32
store i32 0, i32* %location

 ;get the addr of the first element
 %firstelementaddr = getelementptr [8192 x i32]* @values, i32 0
 %dereference = load i32* %firstelementaddr

 ;return 0
 ret i32 0

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment