summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/attr-optnone.c
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
commit0855695159d62d4b900909f84d601e87219d454c (patch)
tree61af814dcc587d3b9f82d008581b811d96177998 /clang/test/CodeGen/attr-optnone.c
parent7eb1f1856c3b6549544256da9c4b881f695903cc (diff)
downloadbcm5719-llvm-0855695159d62d4b900909f84d601e87219d454c.tar.gz
bcm5719-llvm-0855695159d62d4b900909f84d601e87219d454c.zip
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. llvm-svn: 224047
Diffstat (limited to 'clang/test/CodeGen/attr-optnone.c')
-rw-r--r--clang/test/CodeGen/attr-optnone.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/attr-optnone.c b/clang/test/CodeGen/attr-optnone.c
index 020218a2f41..96493bfe361 100644
--- a/clang/test/CodeGen/attr-optnone.c
+++ b/clang/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
OpenPOWER on IntegriCloud