summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2019-06-21 16:03:06 +0000
committerLeonard Chan <leonardchan@google.com>2019-06-21 16:03:06 +0000
commitf66309203e277506a2d4b228d17b4c915c9d56e2 (patch)
tree5b59d5610b33bbfb3d7663d8343592eec5ea7966 /clang/test/CodeGenObjC
parente652f8097b803cbe49b19b2c47341f3771edf6b1 (diff)
downloadbcm5719-llvm-f66309203e277506a2d4b228d17b4c915c9d56e2.tar.gz
bcm5719-llvm-f66309203e277506a2d4b228d17b4c915c9d56e2.zip
[clang][NewPM] Add -fno-experimental-new-pass-manager to tests
As per the discussion on D58375, we disable test that have optimizations under the new PM. This patch adds -fno-experimental-new-pass-manager to RUNS that: - Already run with optimizations (-O1 or higher) that were missed in D58375. - Explicitly test new PM behavior along side some new PM RUNS, but are missing this flag if new PM is enabled by default. - Specify -O without the number. Based on getOptimizationLevel(), it seems the default is 2, and the IR appears to be the same when changed to -O2, so update the test to explicitly say -O2 and provide -fno-experimental-new-pass-manager`. Differential Revision: https://reviews.llvm.org/D63156 llvm-svn: 364066
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/os_log.m12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/test/CodeGenObjC/os_log.m b/clang/test/CodeGenObjC/os_log.m
index 15999c6315d..d41a4ce346d 100644
--- a/clang/test/CodeGenObjC/os_log.m
+++ b/clang/test/CodeGenObjC/os_log.m
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-darwin-apple -fobjc-arc -O2 | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-darwin-apple -fobjc-arc -O2 -fno-experimental-new-pass-manager | FileCheck %s --check-prefixes=CHECK,CHECK-LEGACY
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-darwin-apple -fobjc-arc -O2 -fexperimental-new-pass-manager | FileCheck %s --check-prefixes=CHECK,CHECK-NEWPM
// RUN: %clang_cc1 %s -emit-llvm -o - -triple x86_64-darwin-apple -fobjc-arc -O0 | FileCheck %s -check-prefix=CHECK-O0
// Make sure we emit clang.arc.use before calling objc_release as part of the
@@ -22,7 +23,8 @@ void *test_builtin_os_log(void *buf) {
// CHECK: %[[CALL:.*]] = tail call %[[TY0:.*]]* (...) @GenString()
// CHECK: %[[V0:.*]] = bitcast %[[TY0]]* %[[CALL]] to i8*
// CHECK: %[[V1:.*]] = notail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %[[V0]])
- // CHECK: %[[V2:.*]] = ptrtoint %[[TY0]]* %[[CALL]] to i64
+ // CHECK-LEGACY: %[[V2:.*]] = ptrtoint %[[TY0]]* %[[CALL]] to i64
+ // CHECK-NEWPM: %[[V2:.*]] = ptrtoint i8* %[[V1]] to i64
// CHECK: store i8 2, i8* %[[BUF]], align 1
// CHECK: %[[NUMARGS_I:.*]] = getelementptr i8, i8* %[[BUF]], i64 1
// CHECK: store i8 1, i8* %[[NUMARGS_I]], align 1
@@ -33,8 +35,10 @@ void *test_builtin_os_log(void *buf) {
// CHECK: %[[ARGDATA_I:.*]] = getelementptr i8, i8* %[[BUF]], i64 4
// CHECK: %[[ARGDATACAST_I:.*]] = bitcast i8* %[[ARGDATA_I]] to i64*
// CHECK: store i64 %[[V2]], i64* %[[ARGDATACAST_I]], align 1
- // CHECK: tail call void (...) @llvm.objc.clang.arc.use(%[[TY0]]* %[[CALL]])
- // CHECK: tail call void @llvm.objc.release(i8* %[[V0]])
+ // CHECK-LEGACY: tail call void (...) @llvm.objc.clang.arc.use(%[[TY0]]* %[[CALL]])
+ // CHECK-LEGACY: tail call void @llvm.objc.release(i8* %[[V0]])
+ // CHECK-NEWPM: tail call void (...) @llvm.objc.clang.arc.use(i8* %[[V1]])
+ // CHECK-NEWPM: tail call void @llvm.objc.release(i8* %[[V1]])
// CHECK: ret i8* %[[BUF]]
// clang.arc.use is used and removed in IR optimizations. At O0, we should not
OpenPOWER on IntegriCloud