Diagnose attributes 'optnone' and 'minsize' on the same declaration.
Eventually we'll diagnose them on different declarations, but let's
get this part out of the way first.
llvm-svn: 223985
diff --git a/clang/test/SemaCXX/pragma-optimize.cpp b/clang/test/SemaCXX/pragma-optimize.cpp
index 0a9f041..b84d232 100644
--- a/clang/test/SemaCXX/pragma-optimize.cpp
+++ b/clang/test/SemaCXX/pragma-optimize.cpp
@@ -55,6 +55,13 @@
}
// CHECK-DAG: @_Z3bazi{{.*}} [[ATTRBAZ:#[0-9]+]]
+// This function definition will not be decorated with `optnone` because the
+// attribute would conflict with `minsize`.
+int __attribute__((minsize)) bax(int z) {
+ return foo(z, 2);
+}
+// CHECK-DAG: @_Z3baxi{{.*}} [[ATTRBAX:#[0-9]+]]
+
#pragma clang optimize on
// The function "int wombat(int param)" created by the macro is not
@@ -144,6 +151,7 @@
// Check that the other functions do NOT have optnone.
// CHECK-DAG-NOT: attributes [[ATTRFOO]] = { {{.*}}optnone{{.*}} }
// CHECK-DAG-NOT: attributes [[ATTRBAZ]] = { {{.*}}optnone{{.*}} }
+// CHECK-DAG-NOT: attributes [[ATTRBAX]] = { {{.*}}optnone{{.*}} }
// CHECK-DAG-NOT: attributes [[ATTRWOMBAT]] = { {{.*}}optnone{{.*}} }
// CHECK-DAG-NOT: attributes [[ATTRCONTAINER]] = { {{.*}}optnone{{.*}} }
// CHECK-DAG-NOT: attributes [[ATTRTWICE]] = { {{.*}}optnone{{.*}} }