diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/CodeGen/nonnull.c | |
parent | 30d791273d07fac9c0c1641a0731191bca6e8606 (diff) |
Notes
Diffstat (limited to 'test/CodeGen/nonnull.c')
-rw-r--r-- | test/CodeGen/nonnull.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/nonnull.c b/test/CodeGen/nonnull.c index 4d6cc4568d8b..7c33e6329fdd 100644 --- a/test/CodeGen/nonnull.c +++ b/test/CodeGen/nonnull.c @@ -21,3 +21,31 @@ int * bar3() __attribute__((returns_nonnull)) { return &a; } +// CHECK: define i32 @bar4(i32 %n, i32* nonnull %p) +int bar4(int n, int *p) __attribute__((nonnull)) { + return n + *p; +} + +// CHECK: define i32 @bar5(i32 %n, i32* nonnull %p) +int bar5(int n, int *p) __attribute__((nonnull(1, 2))) { + return n + *p; +} + +typedef union { + unsigned long long n; + int *p; + double d; +} TransparentUnion __attribute__((transparent_union)); + +// CHECK: define i32 @bar6(i64 % +int bar6(TransparentUnion tu) __attribute__((nonnull(1))) { + return *tu.p; +} + +// CHECK: define void @bar7(i32* nonnull %a, i32* nonnull %b) +void bar7(int *a, int *b) __attribute__((nonnull(1))) +__attribute__((nonnull(2))) {} + +// CHECK: define void @bar8(i32* nonnull %a, i32* nonnull %b) +void bar8(int *a, int *b) __attribute__((nonnull)) +__attribute__((nonnull(1))) {} |