diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-27 18:56:18 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-27 18:56:18 +0000 |
commit | 00cc1c09c3b26c50367b24e8cf365308b10ebc76 (patch) | |
tree | dde3aa3fb9ec1c7f930955aa6cc77f442ef6744e /clang/test | |
parent | c26a79d4f2cd82515b7145f8730e6fdfee3ed8a4 (diff) | |
download | bcm5719-llvm-00cc1c09c3b26c50367b24e8cf365308b10ebc76.tar.gz bcm5719-llvm-00cc1c09c3b26c50367b24e8cf365308b10ebc76.zip |
Fix regression in r216520: don't apply nonnull to non-pointer function
parameters in the IR.
llvm-svn: 216574
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/nonnull.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGen/nonnull.c b/clang/test/CodeGen/nonnull.c index 4d6cc4568d8..e234105d9ad 100644 --- a/clang/test/CodeGen/nonnull.c +++ b/clang/test/CodeGen/nonnull.c @@ -21,3 +21,23 @@ 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; +} |