metarenamer.ll 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ; RUN: opt -metarenamer -S < %s | FileCheck %s
  2. ; CHECK: target triple {{.*}}
  3. ; CHECK-NOT: {{^x*}}xxx{{^x*}}
  4. ; CHECK: ret i32 6
  5. target triple = "x86_64-pc-linux-gnu"
  6. %struct.bar_xxx = type { i32, double }
  7. %struct.foo_xxx = type { i32, float, %struct.bar_xxx }
  8. @func_5_xxx.static_local_3_xxx = internal global i32 3, align 4
  9. @global_3_xxx = common global i32 0, align 4
  10. @func_7_xxx = weak alias i32 (...)* @aliased_func_7_xxx
  11. define i32 @aliased_func_7_xxx(...) {
  12. ret i32 0
  13. }
  14. define i32 @func_3_xxx() nounwind uwtable ssp {
  15. ret i32 3
  16. }
  17. define void @func_4_xxx(%struct.foo_xxx* sret %agg.result) nounwind uwtable ssp {
  18. %1 = alloca %struct.foo_xxx, align 8
  19. %2 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 0
  20. store i32 1, i32* %2, align 4
  21. %3 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 1
  22. store float 2.000000e+00, float* %3, align 4
  23. %4 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 2
  24. %5 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 0
  25. store i32 3, i32* %5, align 4
  26. %6 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 1
  27. store double 4.000000e+00, double* %6, align 8
  28. %7 = bitcast %struct.foo_xxx* %agg.result to i8*
  29. %8 = bitcast %struct.foo_xxx* %1 to i8*
  30. call void @llvm.memcpy.p0i8.p0i8.i64(i8* %7, i8* %8, i64 24, i32 8, i1 false)
  31. ret void
  32. }
  33. declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
  34. define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_4_xxx) nounwind uwtable ssp {
  35. %1 = alloca i32, align 4
  36. %2 = alloca i32, align 4
  37. %3 = alloca i32, align 4
  38. %4 = alloca i32, align 4
  39. %local_1_xxx = alloca i32, align 4
  40. %local_2_xxx = alloca i32, align 4
  41. %i = alloca i32, align 4
  42. store i32 %arg_1_xxx, i32* %1, align 4
  43. store i32 %arg_2_xxx, i32* %2, align 4
  44. store i32 %arg_3_xxx, i32* %3, align 4
  45. store i32 %arg_4_xxx, i32* %4, align 4
  46. store i32 1, i32* %local_1_xxx, align 4
  47. store i32 2, i32* %local_2_xxx, align 4
  48. store i32 0, i32* %i, align 4
  49. br label %5
  50. ; <label>:5 ; preds = %9, %0
  51. %6 = load i32, i32* %i, align 4
  52. %7 = icmp slt i32 %6, 10
  53. br i1 %7, label %8, label %12
  54. ; <label>:8 ; preds = %5
  55. br label %9
  56. ; <label>:9 ; preds = %8
  57. %10 = load i32, i32* %i, align 4
  58. %11 = add nsw i32 %10, 1
  59. store i32 %11, i32* %i, align 4
  60. br label %5
  61. ; <label>:12 ; preds = %5
  62. %13 = load i32, i32* %local_1_xxx, align 4
  63. %14 = load i32, i32* %1, align 4
  64. %15 = add nsw i32 %13, %14
  65. %16 = load i32, i32* %local_2_xxx, align 4
  66. %17 = add nsw i32 %15, %16
  67. %18 = load i32, i32* %2, align 4
  68. %19 = add nsw i32 %17, %18
  69. %20 = load i32, i32* @func_5_xxx.static_local_3_xxx, align 4
  70. %21 = add nsw i32 %19, %20
  71. %22 = load i32, i32* %3, align 4
  72. %23 = add nsw i32 %21, %22
  73. %24 = load i32, i32* %4, align 4
  74. %25 = add nsw i32 %23, %24
  75. ret i32 %25
  76. }
  77. define i32 @varargs_func_6_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, ...) nounwind uwtable ssp {
  78. %1 = alloca i32, align 4
  79. %2 = alloca i32, align 4
  80. store i32 %arg_1_xxx, i32* %1, align 4
  81. store i32 %arg_2_xxx, i32* %2, align 4
  82. ret i32 6
  83. }