Snap for 8414339 from 17c8b2c5458cddf6a08e00a58ab71ee8f838261e to tm-qpr1-release
Change-Id: Ic62b38e818244cdc4a1f4a1419322c93884e5bfe
diff --git a/ConstantExpression.cpp b/ConstantExpression.cpp
index 02fbf76..6930c0f 100644
--- a/ConstantExpression.cpp
+++ b/ConstantExpression.cpp
@@ -137,6 +137,11 @@
return static_cast<T>(0xdeadbeef);
}
+// The compiler doesn't know T is at least KIND_INT32, and will instantiate bool
+// version of this function, and will warn about converting the result of '<<'
+// to a boolean.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wint-in-bool-context"
template <class T>
T handleShift(T lval, const std::string& op, int64_t rval) {
// just cast rval to int64_t and it should fit.
@@ -147,6 +152,7 @@
<< lval << " " << op << " " << rval;
return static_cast<T>(0xdeadbeef);
}
+#pragma GCC diagnostic pop
bool handleLogical(bool lval, const std::string& op, bool rval) {
COMPUTE_BINARY(||);
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 13ed681..b3c422b 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -12,5 +12,19 @@
{
"name": "hidl_lazy_test"
}
+ ],
+ "hwasan-postsubmit": [
+ {
+ "name": "hidl_test"
+ },
+ {
+ "name": "hidl_test_java"
+ },
+ {
+ "name": "libhidl-gen-utils_test"
+ },
+ {
+ "name": "hidl_lazy_test"
+ }
]
}
diff --git a/hidl-gen_l.ll b/hidl-gen_l.ll
index 007cd4c..34baa28 100644
--- a/hidl-gen_l.ll
+++ b/hidl-gen_l.ll
@@ -65,6 +65,14 @@
#define YY_DECL int yylex(YYSTYPE* yylval_param, YYLTYPE* yylloc_param, \
yyscan_t yyscanner, android::AST* const ast, android::Scope** const scope)
+#ifndef YYSTYPE
+#define YYSTYPE yy::parser::semantic_type
+#endif
+
+#ifndef YYLTYPE
+#define YYLTYPE yy::parser::location_type
+#endif
+
#define YY_USER_ACTION yylloc->step(); yylloc->columns(yyleng);
%}
diff --git a/test/lazy_test/hidl_lazy_test.cpp b/test/lazy_test/hidl_lazy_test.cpp
index af0e6b9..6bbb161 100644
--- a/test/lazy_test/hidl_lazy_test.cpp
+++ b/test/lazy_test/hidl_lazy_test.cpp
@@ -25,6 +25,7 @@
#include <sys/eventfd.h>
#include <unistd.h>
+#include <android-base/properties.h>
#include <android-base/unique_fd.h>
#include <android/hardware/tests/lazy/1.1/ILazy.h>
#include <android/hardware/tests/lazy_cb/1.0/ILazyCb.h>
@@ -101,7 +102,8 @@
std::cout << "Waiting " << SHUTDOWN_WAIT_TIME << " seconds before checking that the "
<< "service has shut down." << std::endl;
IPCThreadState::self()->flushCommands();
- sleep(SHUTDOWN_WAIT_TIME);
+ int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1);
+ sleep(SHUTDOWN_WAIT_TIME * timeout_multiplier);
for (const auto& instance : gInstances) {
ASSERT_FALSE(isServiceRunning(instance))
<< "Service failed to shutdown " << instance.string();
@@ -143,7 +145,8 @@
IPCThreadState::self()->flushCommands();
std::cout << "Thread for " << instance.string() << " waiting " << sleepTime
<< " while not holding HAL." << std::endl;
- sleep(sleepTime);
+ int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1);
+ sleep(sleepTime * timeout_multiplier);
sp<IBase> hal = getHal(instance);
ASSERT_NE(hal.get(), nullptr);
ASSERT_TRUE(hal->ping().isOk());
@@ -230,7 +233,8 @@
<< " seconds before checking whether the "
<< "service is still running." << std::endl;
- sleep(CALLBACK_SHUTDOWN_WAIT_TIME);
+ int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1);
+ sleep(CALLBACK_SHUTDOWN_WAIT_TIME * timeout_multiplier);
ASSERT_FALSE(isServiceRunning(fqInstance)) << "Service failed to shut down.";
}