blob: 66744b7ccea801c0d65ade8a75252aa9d9f56099 [file] [log] [blame]
Dan Gohmanc2897692010-12-13 23:51:08 +00001// RUN: %clang_cc1 -Werror -triple i386-unknown-unknown -emit-llvm -O1 -disable-llvm-optzns -o %t %s
2// RUN: FileCheck < %t %s
3
4// Types with the may_alias attribute should be considered equivalent
5// to char for aliasing.
6
7typedef int __attribute__((may_alias)) aliasing_int;
8
9void test0(aliasing_int *ai, int *i)
10{
11 *ai = 0;
12 *i = 1;
13}
14
15// CHECK: store i32 0, i32* %tmp, !tbaa !1
16// CHECK: store i32 1, i32* %tmp1, !tbaa !3
17
18// CHECK: !0 = metadata !{metadata !"any pointer", metadata !1}
19// CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2}
20// CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA", null}
21// CHECK: !3 = metadata !{metadata !"int", metadata !1}