• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -O2 -disable-llvm-passes -o - | FileCheck %s
2 // RUN: %clang_cc1 %s -triple %ms_abi_triple -emit-llvm -O2 -disable-llvm-passes -o - | FileCheck %s
3 
4 enum class __attribute__((may_alias)) E {};
5 
6 template<typename T> struct A {
7   using B __attribute__((may_alias)) = enum {};
8 };
9 
10 template<typename T> using Alias = typename A<T>::B;
11 
12 // CHECK-LABEL: define {{.*}}foo
13 // CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS:[^ ,]*]]
foo(E & r)14 auto foo(E &r) { return r; }
15 
16 // CHECK-LABEL: define {{.*}}goo
17 // CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS]]
goo(A<int>::B & r)18 auto goo(A<int>::B &r) { return r; }
19 
20 // CHECK-LABEL: define {{.*}}hoo
21 // CHECK: load i{{[0-9]*}}, {{.*}}, !tbaa ![[MAY_ALIAS]]
hoo(Alias<int> & r)22 auto hoo(Alias<int> &r) { return r; }
23 
24 // CHECK: ![[CHAR:.*]] = !{!"omnipotent char", !{{.*}}, i64 0}
25 // CHECK: ![[MAY_ALIAS]] = !{![[CHAR]], ![[CHAR]], i64 0}
26