aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/SemaTemplate/instantiate-expr-1.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-1.cpp b/test/SemaTemplate/instantiate-expr-1.cpp
index 663749ddce..34fc6af746 100644
--- a/test/SemaTemplate/instantiate-expr-1.cpp
+++ b/test/SemaTemplate/instantiate-expr-1.cpp
@@ -112,3 +112,16 @@ void test_call_operator(CallOperator call_op, int i, double d) {
int &ir = test_call_operator<int&>(call_op, i);
double &dr = test_call_operator<double&>(call_op, d);
}
+
+template<typename T>
+void test_asm(T t) {
+ asm ("nop" : "=a"(*t) : "r"(*t)); // expected-error {{indirection requires pointer operand ('int' invalid)}}
+}
+
+void test_asm() {
+ int* a;
+ test_asm(a);
+
+ int b;
+ test_asm(b); // expected-note {{in instantiation of function template specialization 'test_asm<int>' requested here}}
+}