Moved LLVM examples and added licence headers.

master
Rohan Jacob-Rao 9 years ago
parent b8b62cbcb0
commit 3c0e698671

@ -1,5 +0,0 @@
; Allocate stack variable using alloca instruction
define i32 @main() {
%a = alloca i32
ret i32 0
}

@ -1,4 +0,0 @@
; Definition of main function
define void @main() {
ret void
}

@ -1,5 +0,0 @@
; Definition of main function
define i32 @main() {
%a = load i32* %b
ret i32 0
}

@ -1,4 +0,0 @@
void foo(void) {
int *p = 0;
*p = 42;
}

@ -1,4 +0,0 @@
; Definition of main function
define i32 @main() {
ret i32 %0
}

@ -1,4 +0,0 @@
; Definition of main function
define i32 @main() {
ret i32 0
}

@ -1,5 +0,0 @@
; Function with store instruction
define i32 @main() {
store i32 0, i32* %i
ret i32 0
}

@ -0,0 +1,12 @@
; Copyright (c) 2015 - present Facebook, Inc.
; All rights reserved.
;
; This source code is licensed under the BSD style license found in the
; LICENSE file in the root directory of this source tree. An additional grant
; of patent rights can be found in the PATENTS file in the same directory.
; Allocate stack variable using alloca instruction
define i32 @main() {
%a = alloca i32
ret i32 0
}

@ -0,0 +1,12 @@
; Copyright (c) 2015 - present Facebook, Inc.
; All rights reserved.
;
; This source code is licensed under the BSD style license found in the
; LICENSE file in the root directory of this source tree. An additional grant
; of patent rights can be found in the PATENTS file in the same directory.
; Definition of main function
define i32 @main() {
%a = load i32* %b
ret i32 0
}

@ -0,0 +1,13 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
void foo(void) {
int *p = 0;
*p = 42;
}

@ -1,3 +1,10 @@
; Copyright (c) 2015 - present Facebook, Inc.
; All rights reserved.
;
; This source code is licensed under the BSD style license found in the
; LICENSE file in the root directory of this source tree. An additional grant
; of patent rights can be found in the PATENTS file in the same directory.
; ModuleID = 'null_deref.c'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"

@ -0,0 +1,11 @@
; Copyright (c) 2015 - present Facebook, Inc.
; All rights reserved.
;
; This source code is licensed under the BSD style license found in the
; LICENSE file in the root directory of this source tree. An additional grant
; of patent rights can be found in the PATENTS file in the same directory.
; Definition of main function
define i32 @main() {
ret i32 0
}

@ -0,0 +1,11 @@
; Copyright (c) 2015 - present Facebook, Inc.
; All rights reserved.
;
; This source code is licensed under the BSD style license found in the
; LICENSE file in the root directory of this source tree. An additional grant
; of patent rights can be found in the PATENTS file in the same directory.
; Definition of main function
define i32 @main() {
ret i32 %0
}

@ -0,0 +1,11 @@
; Copyright (c) 2015 - present Facebook, Inc.
; All rights reserved.
;
; This source code is licensed under the BSD style license found in the
; LICENSE file in the root directory of this source tree. An additional grant
; of patent rights can be found in the PATENTS file in the same directory.
; Definition of main function
define void @main() {
ret void
}

@ -0,0 +1,12 @@
; Copyright (c) 2015 - present Facebook, Inc.
; All rights reserved.
;
; This source code is licensed under the BSD style license found in the
; LICENSE file in the root directory of this source tree. An additional grant
; of patent rights can be found in the PATENTS file in the same directory.
; Function with store instruction
define i32 @main() {
store i32 0, i32* %i
ret i32 0
}
Loading…
Cancel
Save