r356354 - Add testcase from bug 41079

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 17 16:16:31 PDT 2019


Author: arsenm
Date: Sun Mar 17 16:16:31 2019
New Revision: 356354

URL: http://llvm.org/viewvc/llvm-project?rev=356354&view=rev
Log:
Add testcase from bug 41079

Modified:
    cfe/trunk/test/CodeGen/builtin-expect.c

Modified: cfe/trunk/test/CodeGen/builtin-expect.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtin-expect.c?rev=356354&r1=356353&r2=356354&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtin-expect.c (original)
+++ cfe/trunk/test/CodeGen/builtin-expect.c Sun Mar 17 16:16:31 2019
@@ -78,3 +78,20 @@ int switch_cond(int x) {
   return 0;
 }
 
+int variable_expected(int stuff) {
+// ALL-LABEL: define i32 @variable_expected(
+// O1: call i64 @llvm.expect.i64(i64 {{%.*}}, i64 {{%.*}})
+// O0-NOT: @llvm.expect
+
+  int res = 0;
+
+  switch (__builtin_expect(stuff, stuff)) {
+  case 0:
+    res = 1;
+    break;
+  default:
+    break;
+  }
+
+  return res;
+}




More information about the cfe-commits mailing list