aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/enable_if.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:44:14 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:44:14 +0000
commit2b6b257f4e5503a7a2675bdb8735693db769f75c (patch)
treee85e046ae7003fe3bcc8b5454cd0fa3f7407b470 /test/CodeGen/enable_if.c
parentb4348ed0b7e90c0831b925fbee00b5f179a99796 (diff)
Notes
Diffstat (limited to 'test/CodeGen/enable_if.c')
-rw-r--r--test/CodeGen/enable_if.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGen/enable_if.c b/test/CodeGen/enable_if.c
index f863d80c14ab..5e9f904fdd3f 100644
--- a/test/CodeGen/enable_if.c
+++ b/test/CodeGen/enable_if.c
@@ -80,3 +80,16 @@ void test4() {
// CHECK: store void (i32)* @_Z3quxUa9enable_ifIXLi1EEXL_Z9TRUEFACTSEEEi
p = &qux;
}
+
+// There was a bug where, when enable_if was present, overload resolution
+// wouldn't pay attention to lower-priority attributes.
+// (N.B. `foo` with pass_object_size should always be preferred)
+// CHECK-LABEL: define void @test5
+void test5() {
+ int foo(char *i) __attribute__((enable_if(1, ""), overloadable));
+ int foo(char *i __attribute__((pass_object_size(0))))
+ __attribute__((enable_if(1, ""), overloadable));
+
+ // CHECK: call i32 @_Z3fooUa9enable_ifIXLi1EEEPcU17pass_object_size0
+ foo((void*)0);
+}