aboutsummaryrefslogtreecommitdiff
path: root/notes/annotations
diff options
context:
space:
mode:
authorazidar2015-03-10 18:08:07 -0700
committerazidar2015-03-10 18:08:07 -0700
commit70e1a41b15632afd969fff7ed6100eba0be78297 (patch)
treeeb5fecb25dd546c10cbb0728e22eb95c6679cc6e /notes/annotations
parent0f3a31df12584207204054215867d84890a98a62 (diff)
Finished resolve genders
Diffstat (limited to 'notes/annotations')
-rw-r--r--notes/annotations/hello.c7
-rw-r--r--notes/annotations/hello.ll30
2 files changed, 37 insertions, 0 deletions
diff --git a/notes/annotations/hello.c b/notes/annotations/hello.c
new file mode 100644
index 00000000..db37785d
--- /dev/null
+++ b/notes/annotations/hello.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main (int a) {
+ for( int i = 0; i < a; i++) {
+ return printf("Hello World\n");
+ }
+}
diff --git a/notes/annotations/hello.ll b/notes/annotations/hello.ll
new file mode 100644
index 00000000..3b0381e1
--- /dev/null
+++ b/notes/annotations/hello.ll
@@ -0,0 +1,30 @@
+; ModuleID = 'hello.c'
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.9.0"
+
+@.str = private unnamed_addr constant [13 x i8] c"Hello World\0A\00", align 1
+
+; Function Attrs: nounwind ssp uwtable
+define i32 @main(i32 %a) #0 {
+ %1 = icmp sgt i32 %a, 0
+ br i1 %1, label %2, label %4
+
+; <label>:2 ; preds = %0
+ %3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([13 x i8]* @.str, i64 0, i64 0)) #2
+ br label %4
+
+; <label>:4 ; preds = %2, %0
+ %.0 = phi i32 [ %3, %2 ], [ 0, %0 ]
+ ret i32 %.0
+}
+
+; Function Attrs: nounwind
+declare i32 @printf(i8* nocapture readonly, ...) #1
+
+attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #2 = { nounwind }
+
+!llvm.ident = !{!0}
+
+!0 = metadata !{metadata !"Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)"}