blob: 4e7707aaeed9c73a746e0e296e76911ce45f52d1 [file] [log] [blame]
George Burgess IVbf1a70f2016-12-01 20:16:56 +00001// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-linux-gnu | FileCheck %s
George Burgess IV2a6150d2015-10-16 01:17:38 +00002
3// Test address-of overloading logic
4int test5(int);
5template <typename T>
6T test5(T) __attribute__((enable_if(1, "better than non-template")));
7
8// CHECK: @_Z5test5IiEUa9enable_ifIXLi1EEET_S0_
9int (*Ptr)(int) = &test5;
10
Nick Lewycky0c2986f2014-04-26 00:14:00 +000011// Test itanium mangling for attribute enable_if
12
13// CHECK: _Z5test1Ua9enable_ifIXeqfL0p_Li1EEEi
14void test1(int i) __attribute__((enable_if(i == 1, ""))) {}
15
16void ext();
17// CHECK: _Z5test2Ua9enable_ifIXneadL_Z3extvELi0EEEi
18void test2(int i) __attribute__((enable_if(&ext != 0, ""))) {}
19
20// CHECK: _Z5test3Ua9enable_ifIXeqfL0p_Li1EEXeqfL0p0_Li2EEEii
21void test3(int i, int j) __attribute__((enable_if(i == 1, ""), enable_if(j == 2, ""))) {}
22
23// CHECK: _ZN5test4IdE1fEUa9enable_ifIXeqfL0p_Li1EEXeqfL0p0_Li2EEEi
24template <typename T>
25class test4 {
26 virtual void f(int i, int j) __attribute__((enable_if(i == 1, ""))) __attribute__((enable_if(j == 2, "")));
27};
28
29template class test4<double>;