default.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ; ModuleID = 'test.c'
  2. target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  3. target triple = "x86_64-unknown-linux-gnu"
  4. %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
  5. %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
  6. %struct.what = type { i8, i16 }
  7. @.str = private unnamed_addr constant [6 x i8] c"foo()\00", align 1
  8. @e_long = common global i64 0, align 8
  9. @g_double = common global double 0.000000e+00, align 8
  10. @.str.1 = private unnamed_addr constant [7 x i8] c"oooooh\00", align 1
  11. @func_ptr = common global i32 (...)* null, align 8
  12. @.str.2 = private unnamed_addr constant [8 x i8] c"success\00", align 1
  13. @.str.3 = private unnamed_addr constant [9 x i8] c"FizzBuzz\00", align 1
  14. @.str.4 = private unnamed_addr constant [5 x i8] c"Fizz\00", align 1
  15. @.str.5 = private unnamed_addr constant [5 x i8] c"Buzz\00", align 1
  16. @.str.6 = private unnamed_addr constant [4 x i8] c"%zd\00", align 1
  17. @.str.7 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
  18. @.str.8 = private unnamed_addr constant [12 x i8] c"%d, %c, %d\0A\00", align 1
  19. @.str.9 = private unnamed_addr constant [11 x i8] c"need args!\00", align 1
  20. @stderr = external global %struct._IO_FILE*, align 8
  21. ; Function Attrs: nounwind uwtable
  22. define i32 @foo() #0 {
  23. %1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0))
  24. ret i32 0
  25. }
  26. declare i32 @puts(i8*) #1
  27. ; Function Attrs: nounwind uwtable
  28. define i32 @main(i32 %argc, i8** %argv) #0 {
  29. %1 = alloca i32, align 4
  30. %2 = alloca i32, align 4
  31. %3 = alloca i8**, align 8
  32. %b_char = alloca i8, align 1
  33. %d_int = alloca i32, align 4
  34. %cp_char_ptr = alloca i8*, align 8
  35. %X = alloca %struct.what, align 2
  36. %i = alloca i64, align 8
  37. store i32 0, i32* %1, align 4
  38. store i32 %argc, i32* %2, align 4
  39. store i8** %argv, i8*** %3, align 8
  40. %4 = load i8**, i8*** %3, align 8
  41. %5 = load i32, i32* %2, align 4
  42. %6 = icmp eq i32 %5, 1
  43. br i1 %6, label %7, label %11
  44. ; <label>:7 ; preds = %0
  45. %8 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  46. store i8 1, i8* %8, align 2
  47. store i8 49, i8* %b_char, align 1
  48. %9 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 1
  49. store i16 128, i16* %9, align 2
  50. store i32 65536, i32* %d_int, align 4
  51. store i64 2147483648, i64* @e_long, align 8
  52. store double 1.000000e+01, double* @g_double, align 8
  53. store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %cp_char_ptr, align 8
  54. store i32 (...)* bitcast (i32 ()* @foo to i32 (...)*), i32 (...)** @func_ptr, align 8
  55. %10 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0))
  56. store i32 10, i32* %1, align 4
  57. br label %66
  58. ; <label>:11 ; preds = %0
  59. %12 = load i32, i32* %2, align 4
  60. %13 = icmp eq i32 %12, 2
  61. br i1 %13, label %14, label %63
  62. ; <label>:14 ; preds = %11
  63. store i64 0, i64* %i, align 8
  64. br label %15
  65. ; <label>:15 ; preds = %43, %14
  66. %16 = load i64, i64* %i, align 8
  67. %17 = icmp ult i64 %16, 100
  68. br i1 %17, label %18, label %46
  69. ; <label>:18 ; preds = %15
  70. %19 = load i64, i64* %i, align 8
  71. %20 = urem i64 %19, 15
  72. %21 = icmp ne i64 %20, 0
  73. br i1 %21, label %24, label %22
  74. ; <label>:22 ; preds = %18
  75. %23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0))
  76. br label %41
  77. ; <label>:24 ; preds = %18
  78. %25 = load i64, i64* %i, align 8
  79. %26 = urem i64 %25, 3
  80. %27 = icmp ne i64 %26, 0
  81. br i1 %27, label %30, label %28
  82. ; <label>:28 ; preds = %24
  83. %29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0))
  84. br label %40
  85. ; <label>:30 ; preds = %24
  86. %31 = load i64, i64* %i, align 8
  87. %32 = urem i64 %31, 5
  88. %33 = icmp ne i64 %32, 0
  89. br i1 %33, label %36, label %34
  90. ; <label>:34 ; preds = %30
  91. %35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0))
  92. br label %39
  93. ; <label>:36 ; preds = %30
  94. %37 = load i64, i64* %i, align 8
  95. %38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i64 %37)
  96. br label %39
  97. ; <label>:39 ; preds = %36, %34
  98. br label %40
  99. ; <label>:40 ; preds = %39, %28
  100. br label %41
  101. ; <label>:41 ; preds = %40, %22
  102. %42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i32 0, i32 0))
  103. br label %43
  104. ; <label>:43 ; preds = %41
  105. %44 = load i64, i64* %i, align 8
  106. %45 = add i64 %44, 1
  107. store i64 %45, i64* %i, align 8
  108. br label %15
  109. ; <label>:46 ; preds = %15
  110. %47 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  111. store i8 1, i8* %47, align 2
  112. store i8 49, i8* %b_char, align 1
  113. %48 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 1
  114. store i16 128, i16* %48, align 2
  115. store i32 65536, i32* %d_int, align 4
  116. store i64 2147483648, i64* @e_long, align 8
  117. store double 1.000000e+01, double* @g_double, align 8
  118. store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %cp_char_ptr, align 8
  119. store i32 (...)* bitcast (i32 ()* @foo to i32 (...)*), i32 (...)** @func_ptr, align 8
  120. %49 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  121. %50 = load i8, i8* %49, align 2
  122. %51 = trunc i8 %50 to i1
  123. %52 = zext i1 %51 to i32
  124. %53 = load i8, i8* %b_char, align 1
  125. %54 = sext i8 %53 to i32
  126. %55 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 1
  127. %56 = load i16, i16* %55, align 2
  128. %57 = sext i16 %56 to i32
  129. %58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i32 0, i32 0), i32 %52, i32 %54, i32 %57)
  130. %59 = getelementptr inbounds %struct.what, %struct.what* %X, i32 0, i32 0
  131. %60 = load i8, i8* %59, align 2
  132. %61 = trunc i8 %60 to i1
  133. %62 = zext i1 %61 to i32
  134. store i32 %62, i32* %1, align 4
  135. br label %66
  136. ; <label>:63 ; preds = %11
  137. %64 = load %struct._IO_FILE*, %struct._IO_FILE** @stderr, align 8
  138. %65 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i32 0, i32 0), %struct._IO_FILE* %64)
  139. store i32 -1, i32* %1, align 4
  140. br label %66
  141. ; <label>:66 ; preds = %63, %46, %7
  142. %67 = load i32, i32* %1, align 4
  143. ret i32 %67
  144. }
  145. declare i32 @printf(i8*, ...) #1
  146. declare i32 @fputs(i8*, %struct._IO_FILE*) #1
  147. attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
  148. attributes #1 = { "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
  149. !llvm.ident = !{!0}
  150. !0 = !{!"clang version 3.8.0 (tags/RELEASE_380/final)"}