[llvm] 6a05ee0 - [Attributor][NFC] Reorder test functions

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 21:53:36 PST 2019


Author: Johannes Doerfert
Date: 2019-12-13T23:51:59-06:00
New Revision: 6a05ee05b68790c79f0faa31beb54a06ca05f72f

URL: https://github.com/llvm/llvm-project/commit/6a05ee05b68790c79f0faa31beb54a06ca05f72f
DIFF: https://github.com/llvm/llvm-project/commit/6a05ee05b68790c79f0faa31beb54a06ca05f72f.diff

LOG: [Attributor][NFC] Reorder test functions

Since one of the functions has a personality the attribute set is
printed. If the function is the first it should (hopefully) always be #0

Added: 
    

Modified: 
    llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll
index e110c0a65c95..04927726daa2 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll
+++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll
@@ -3,6 +3,29 @@
 
 ; FIXME: icmp folding is missing
 
+define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
+; CHECK-LABEL: define {{[^@]+}}@invokecaller
+; CHECK-SAME: (i1 [[C:%.*]]) #0 personality i32 (...)* @__gxx_personality_v0
+; CHECK-NEXT:    [[X:%.*]] = call i32 @foo(i1 [[C]])
+; CHECK-NEXT:    br label [[OK:%.*]]
+; CHECK:       .i2c:
+; CHECK-NEXT:    unreachable
+; CHECK:       OK:
+; CHECK-NEXT:    [[Y:%.*]] = icmp ne i32 52, 0
+; CHECK-NEXT:    ret i1 [[Y]]
+; CHECK:       FAIL:
+; CHECK-NEXT:    unreachable
+;
+  %X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL             ; <i32> [#uses=1]
+OK:
+  %Y = icmp ne i32 %X, 0          ; <i1> [#uses=1]
+  ret i1 %Y
+FAIL:
+  %exn = landingpad {i8*, i32}
+  cleanup
+  ret i1 false
+}
+
 define internal i32 @foo(i1 %C) {
 ; CHECK-LABEL: define {{[^@]+}}@foo
 ; CHECK-SAME: (i1 [[C:%.*]])
@@ -33,27 +56,4 @@ define i1 @caller(i1 %C) {
   ret i1 %Y
 }
 
-define i1 @invokecaller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
-; CHECK-LABEL: define {{[^@]+}}@invokecaller
-; CHECK-SAME: (i1 [[C:%.*]]) #0 personality i32 (...)* @__gxx_personality_v0
-; CHECK-NEXT:    [[X:%.*]] = call i32 @foo(i1 [[C]])
-; CHECK-NEXT:    br label [[OK:%.*]]
-; CHECK:       .i2c:
-; CHECK-NEXT:    unreachable
-; CHECK:       OK:
-; CHECK-NEXT:    [[Y:%.*]] = icmp ne i32 52, 0
-; CHECK-NEXT:    ret i1 [[Y]]
-; CHECK:       FAIL:
-; CHECK-NEXT:    unreachable
-;
-  %X = invoke i32 @foo( i1 %C ) to label %OK unwind label %FAIL             ; <i32> [#uses=1]
-OK:
-  %Y = icmp ne i32 %X, 0          ; <i1> [#uses=1]
-  ret i1 %Y
-FAIL:
-  %exn = landingpad {i8*, i32}
-  cleanup
-  ret i1 false
-}
-
 declare i32 @__gxx_personality_v0(...)


        


More information about the llvm-commits mailing list