summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorPaul Robinson <paul_robinson@playstation.sony.com>2014-12-11 20:14:04 +0000
committerPaul Robinson <paul_robinson@playstation.sony.com>2014-12-11 20:14:04 +0000
commit161fab8917bbd51cc7ec9a82db93375cb55e95d4 (patch)
tree197bf8ceb28c0a831705f141ba9f197f3ab44917 /test/CodeGen
parent70cbabae2254037475bd93211f18acda558a9f9e (diff)
downloadclang-161fab8917bbd51cc7ec9a82db93375cb55e95d4.tar.gz
Instead of having -Os/-Oz add OptimizeForSize/MinSize first, and later
having OptimizeNone remove them again, just don't add them in the first place if the function already has OptimizeNone. Note that MinSize can still appear due to attributes on different declarations; a future patch will address that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224047 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/attr-optnone.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/attr-optnone.c b/test/CodeGen/attr-optnone.c
index 020218a2f4..96493bfe36 100644
--- a/test/CodeGen/attr-optnone.c
+++ b/test/CodeGen/attr-optnone.c
@@ -4,10 +4,14 @@
// RUN: %clang_cc1 -emit-llvm -Os < %s > %t
// RUN: FileCheck %s --check-prefix=PRESENT < %t
// RUN: FileCheck %s --check-prefix=OPTSIZE < %t
+// RUN: %clang_cc1 -emit-llvm -Oz < %s > %t
+// RUN: FileCheck %s --check-prefix=PRESENT < %t
+// RUN: FileCheck %s --check-prefix=MINSIZE < %t
__attribute__((always_inline))
int test2() { return 0; }
// OPTSIZE: @test2{{.*}}[[ATTR2:#[0-9]+]]
+// MINSIZE: @test2{{.*}}[[ATTR2:#[0-9]+]]
__attribute__((optnone))
int test3() { return 0; }
@@ -31,3 +35,8 @@ int test4() { return test2(); }
// OPTSIZE-NOT: optsize
// OPTSIZE: attributes [[ATTR2]] = { {{.*}}optsize{{.*}} }
// OPTSIZE-NOT: optsize
+
+// With -Oz, check that 'minsize' appears only on test2.
+// MINSIZE-NOT: minsize
+// MINSIZE: attributes [[ATTR2]] = { {{.*}}minsize{{.*}} }
+// MINSIZE-NOT: minsize