From f8bcc0c61035bbb185cfdfa9f1c23e46e5cdd653 Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Sun, 23 Aug 2015 02:38:29 +0000 Subject: [PATCH] [dsymutil] Refactor ODR uniquing tests to be more readable. This patch adds all the refactored tests in new files, the old tests will be removed by a followup commit. Thanks to D. Blaikie for all the feedback. llvm-svn: 245803 --- .../dsymutil/Inputs/odr-anon-namespace/1.o | Bin 0 -> 2084 bytes .../dsymutil/Inputs/odr-anon-namespace/2.o | Bin 0 -> 2084 bytes .../dsymutil/Inputs/odr-member-functions/1.o | Bin 0 -> 2236 bytes .../dsymutil/Inputs/odr-member-functions/2.o | Bin 0 -> 2660 bytes .../dsymutil/Inputs/odr-member-functions/3.o | Bin 0 -> 2832 bytes .../tools/dsymutil/Inputs/odr-uniquing/1.o | Bin 0 -> 2544 bytes .../tools/dsymutil/X86/dummy-debug-map.map | 22 +++ llvm/test/tools/dsymutil/X86/lit.local.cfg | 2 + .../tools/dsymutil/X86/odr-anon-namespace.cpp | 65 ++++++ .../dsymutil/X86/odr-member-functions.cpp | 109 ++++++++++ llvm/test/tools/dsymutil/X86/odr-uniquing.cpp | 187 ++++++++++++++++++ 11 files changed, 385 insertions(+) create mode 100644 llvm/test/tools/dsymutil/Inputs/odr-anon-namespace/1.o create mode 100644 llvm/test/tools/dsymutil/Inputs/odr-anon-namespace/2.o create mode 100644 llvm/test/tools/dsymutil/Inputs/odr-member-functions/1.o create mode 100644 llvm/test/tools/dsymutil/Inputs/odr-member-functions/2.o create mode 100644 llvm/test/tools/dsymutil/Inputs/odr-member-functions/3.o create mode 100644 llvm/test/tools/dsymutil/Inputs/odr-uniquing/1.o create mode 100644 llvm/test/tools/dsymutil/X86/dummy-debug-map.map create mode 100644 llvm/test/tools/dsymutil/X86/odr-anon-namespace.cpp create mode 100644 llvm/test/tools/dsymutil/X86/odr-member-functions.cpp create mode 100644 llvm/test/tools/dsymutil/X86/odr-uniquing.cpp diff --git a/llvm/test/tools/dsymutil/Inputs/odr-anon-namespace/1.o b/llvm/test/tools/dsymutil/Inputs/odr-anon-namespace/1.o new file mode 100644 index 0000000000000000000000000000000000000000..20d4b7fd84ed29a70148b93034b2c440accf94ce GIT binary patch literal 2084 zcmb7E%}*0i5TCdGptev8c))1P9@La5Z39F;G!X)7HAW4fG#Y*B7f@_>Yrg;w>PaCn zMsJ?|6HL5%@va^{dDEB}jVEJ_iZi?O+Om{bCz&^I=FR+e-pssx^YhD}4glc-T#((! zZ)wqyk@g}dNZ)}zYWBf5_E9=w0&y3|Nm z%GM~~t@$auiyYoAUd~uBDa48QnsJs`zU2JgVH5c3E%PfSjm2zvJKixGh9)|!3fiza z@RG%1J}Zr6f#9~~r|=RS-!7h+TDBVEyze8Hwy1V_OX8- z%1$~)zJ%ONbYH%6v$?JP<@m;j>#x#z9DBW%EtPYop$|nyBQZT(DOHV|`rz>J;8?6* z59jl>LbPEUiS>h-DGekI(-^R(9J`f`q>Dv}RtiN}FintGhfvfY4PkOyE11=?Uia;X zDG=S_P_WnI3WmJ@H;CSG8;3Qt$H4K{HR?qh06CM+E0^rfW z6$}Jy1u}SNyYN1%AZ{4pDyTk?sz#4n)G&xE^LRXqETY1tJz15sjorW%+~SC5g;a4A zAU-=8rwqC?m*3^f`)Ay27=RM|&&WW*_o% z`k)CqZ~c0RX+jd2e6ArAIb-+OX6xlp-Y)Rq-;rhv;L{5YhEZCVMoCquR}A+yaV=HC z$_xrw+@1lk8WN$-4&P(+qB-A>y#AYNw7IEz0h7VdeQl~s>F3Z#g8^KH*mQT{D(D-? yVyCggV}M=t6kQSF5q@3MFcz#iK;ezrAl}0)53oc*;NEeTxQE@eD3WTJ0saCMl-;fX literal 0 HcmV?d00001 diff --git a/llvm/test/tools/dsymutil/Inputs/odr-anon-namespace/2.o b/llvm/test/tools/dsymutil/Inputs/odr-anon-namespace/2.o new file mode 100644 index 0000000000000000000000000000000000000000..df8e567bc3a58bcf26b9d45eade8b54b3b72c317 GIT binary patch literal 2084 zcmb7E&1(};5TCdCXiVCeekc`1_MjyNo0c}%4+UH5M-)+Ms||`i(j;wDliirFwjR`z zwjiQ6&;AL5S1;bxqbF~QAc`juQRB?+yd>SG7zgIfn|U+8oi{UY-~9aYrwu^302gF8 z@>^PTWTbt_ang67kD7h(jeV4km_XdYaZ;AjYb91tNI7>ZK3CV(&dVFZ+wxgA+*3Xz zrA(z4%1g3XDp+PIPtH%xoUXYjoOQN*-vVYCIdj`V;bqOFWpLu%WgI0;kJ{B_Q@q5& zLLptDe7EMO@Gf$At9Th>(WDS3-fPBLX8DrydxuTnt2fQBkT90g#qD@UX&4%)PZhLo zbKoWN`D|Jmi5$Ug%TM9OIlfgqb7945i1WUWIKM-Tcjtfd%O{dfyyuK}objHuh*w(A zH@)vy#yi7!@BfLHG;^3&NtTV(jFFP^{7DYA#28mwXJZ)qN^kZDO8%6iAL(VeSio-B z0nYapXYWbIi!mOn5CBl4WSMI3BV$;I&iXxNybBDlfp`}An&(G-3z0*>Z@E!;FS3vQ zdr`L2G4dtkMxy)jog2+9?JvhRKU{y6%;MPVm2{z)F%5krG8P%q!=*ymxTz0Eqr>Av z{dzc?t>gylw$Y(}FjIwrgkc&3)|6wn(vf674}+y#9u`d#n?(47bsT z{G2{$g7#a#9v(rNKqjAS$VATA9@}ia9Ln1T9{fAfi~)Rlp+OX-b!n7Tg<8dMZxh#2 zC9KS#kj3p85Njb3YH#yBMlYK41IQb{sYcbR>IF;%L-)1m4yB(%9}Na@6{70yz*W#U zki|}8hsOZBYAL#Ugh%*wO~Y8Q<^Y9v&<64Lu{_8U1%Z1fSmGXb)1pYKVFvgMHRatb literal 0 HcmV?d00001 diff --git a/llvm/test/tools/dsymutil/Inputs/odr-member-functions/1.o b/llvm/test/tools/dsymutil/Inputs/odr-member-functions/1.o new file mode 100644 index 0000000000000000000000000000000000000000..f957a9b9d4231eb0601998a84ceb8a6e6e769706 GIT binary patch literal 2236 zcmb7FOKTHR6h3z*=_AvoY2!jsWELuQVH&ky)nZ$$QlW^L))qmAB%Rb~G6|DuS_?wK zN9{svSGx2Uh$!xb{s8?6Zd{4bm57M(JCl3UWZGgqaGv*^Z_YjU-sID-?|<5fgia9P z5co3-6AU^8o@IXzTH!*_mdsH;Fp0UF7eSWg*-KvCuKQD0W~a7&Wwl9z@mf9`q7{|H z+Op>C%)-1?@mxP_S>rQfH?KBQ6wZc>{AdC5gIXgQhQce9vVJ&-_p&(|_G&l~Alel# zoyoX%mGN8qQ+Ue~X1{oOCs*QYkzLqnYSxD@irx%groOr zpenFqzv*(hU|UYQ$Z$LQQ+Ttoe!qC7%su}=g8MxzcXLeQ8GPAVDX`zB{>tfW5N{-a zH?U7U??HLj{bnUzPWF`gCtkKxL|>k@;4J2yIm?nT_Mt)?f|zTVl)7I5v&s_jPOeggM6Wm=jfeGUtnF~LSM*_fT3qN+!?<8v z#0>O=SRIY(QTB$rMlhLBn6AYKVT9QrYU}Y;`!Uj^mka|n9SNZJiP1=-lIuDLNsH8h zxQyO_>vy5UpJ|BB$tgCEUA=y78jC`7>NC*%FhxX&&=MP@&#RcBV&R7fk-iA=2rRnP z0{TrL(9S;<;gGy52*PC&w^kv2{65jCZ7jXuV4O>cCQ@S)+$wj?%-4j8V*(I05c_MD zXU4bw^t~b26JQ?>`Z1V^KfyK1SGfKd5Z?{=e{xiR2Y|(-gSkJQ!uV_Bi%ov7KR;-c zTzO`U!cT$y5kvEC`Gi0`CT@$z$uDOo$;qkS8wu*;V)-VCrI?6ywRfx|i&2h%w|?`u zYBe=^8jHrBYL~l}KZzWT1|Wr~g}NaHe*-M`ehx^$MXTQ`SbDDri-@UdsD2I~#cfZd YJ|Xo{siFM!VX66JJuDPi>d_GW1sA*cNdN!< literal 0 HcmV?d00001 diff --git a/llvm/test/tools/dsymutil/Inputs/odr-member-functions/2.o b/llvm/test/tools/dsymutil/Inputs/odr-member-functions/2.o new file mode 100644 index 0000000000000000000000000000000000000000..c696866fcad6673668009c72209d0f1e96f117cd GIT binary patch literal 2660 zcmb7FO=w(I6h3!e-XxhfGo3byifx@mS`ug`lQi_lmNub{PD>FLPqgm zjbZQ#<*esw#{1bMYWd?f@zR-0H8&%&72ci4#LJf^%AC@ScZ-Jy8qjhf=-c`*Y`Wi1HQt0S=)?cT%a)6%tL{#huH;MOu6you z!(JrD%K(adBLuHEsr;dw%BpH_6w(&K7WU z;xoBwEnhCh49*GGpUT%H4>#w`NKMpE zwJ+LXThUnX+2~HS3!4daC@bnX&pXG^O)H_U4@Rvht>fX7VZ5xioaq>VVp9r|9%y|{C zQ5(@dOqL|8gv3&8J|6qS6rjelKjXV3Z~=-^?bb!eEcK95Ewfa_nlwJg`0P2j#JYlE z9<0J9fUPFrXsuzeTiOmW_%4R_>lkj+@)O$5QvYN_B=k0Yjt9+e)FV@%dWA4vW&2b( zaP!hFm});4i(JF-1emnP7oxhNftypDBax3V9MJw#TB>fuXITJb{d3=&8XZcpS-f~; zwA&;4P`Ipu=wM$h@KSBjdH=@khaZD~>q=i{XQ#mI+aj3dGVe?9ui%h(5+ZCURb#X1 zw3$O<*|a&2Wa`q>H?8Y&a#%mvG>tWKf0o$Tx8Hm2b>&V#l2;dy1L>nPMXyE7s_Lx~QL`}>3%9nthb&It4gTz3uD!Zyj$VeMv4y~?i2nV0 z9S%q@GL>3wiC|P*1FW`w3y^@X(7zDStWITHA{poj+z? zrZG?m1Z=X9G$10l(;|XD3#nTvw1{+*F1m0lSP-qdE`oybJNIXj%p^1(IQRVC@1A?^ zyLV>e@4xL6}_#m9FfGv8jn| z+i1^gh4FaVd{os1W69*ORCt+EDjyUXHVAg(`J4obD?yhvo;JyC!kf;f=VyazSdl3~ zFnV$1{97iSdbM_2%Yxo-J%PyDp`#v!moH_cyAki#oypK&h%`9%!Aqsnm28doySqMv z_nn40C|<5OQ{pL&cx(JIfS%EEL)RDLJoM+V=YA`x;%v6sjCV_C4=7mrjXw_1$NS=? z%H@1ED5eSw*Hqs_jdxR`5FKvQ%C=~zPvMo)SLA^-?su9m0H|9Dx^+N2SzkGoX~bJ; z!29`tc;N@-J@@;K#+%XgJ$@=)rc^*(VK863mMcyN!MRaARf;3}5QnvMs-1|JxQ+AB zjce#%b}pEy;55{P#``v<@#Zw%ry5V2Xbk*-it|$>3`*%mrhb z-~?ACa`8vN4|V<%NPb&T2fYX0Nu0ZDvpa)N(I=CukCMxe6UmRRZ~pi)l7Ht3$>n>A zOLtk5@zv{_tMgAT-Oc22JN#O+-L(6}jbYFB*cytx5ySJ~(Alm*C=M$`k$wmpKLo8E(r)V}+dJdBnB3k6_(Nhi zT8ChO=pb29g~;<=lQiA+Hq4kKqiTt`GI()LrA|Co>L}af!_`73`4m7+hdv3X5bgFw z$PDXIAzD6Rh3r}5bB)jW3@);-VOR!>mGim;wYZW^aZ{UEJWpaF zAri6HwwuV}MHqACAMXCvmN`=z@e&_eZ^q5v2+kV?FX=qJ4mIZSmu^u%Mj^IZ;ur*TuSpWb4 literal 0 HcmV?d00001 diff --git a/llvm/test/tools/dsymutil/Inputs/odr-uniquing/1.o b/llvm/test/tools/dsymutil/Inputs/odr-uniquing/1.o new file mode 100644 index 0000000000000000000000000000000000000000..c520930300555c8166c93b145416c707e7ae9a6c GIT binary patch literal 2544 zcmb7FU1(fY5T0}QH@nHY%}P?Kl*P7o^N>wwmo}+rv!uqvwy892U5awE+1w->ckkWo zPfXMYL9G@Pst-j3!G|K)f(S(rU)2YTpbz@!n}Q-jLD5ow;y34>vp+Wp#DO_;X3ora z&Y78W@7H&K{WnA;e1rk)2Y%tBl`yK8^RTg4rov(Oz&k#EbVZ7Y`(q98?Lo*4518 zmglSH?M17$8Sjw}Z=y68vy(bJOfz4plq}QEml`SCA1_la}!0ui%t%uDaQGcqdg*4tPvoZF9c;Sc|hmG{U2NJi8&kRsKIfc0&uCUaONesl4sj z>t&}=OUlQBqFV!$g>jr3BzB1du|&WZiwF0_c8Olx(?|$kEE+u)eF(|$C8(wNN3r7C z14f%Y*xwcr>cPrXg55@t>u?%d^op^_t79=Y_&D<1l_4YIs#6J~NFPllG<0-SxO>n) zNU_^xVVQqF9aTx6Y)iiW^ctsO6r#^}M#_HjU*O3D0e)jb?4#gCIT;MGfxAkijeVq+ z(;*Ijo~=W$`dqLfYQ7`Ajkquir>EHQanWVGxyF4fPX3G$T7~~P;?xmWTf&!^#OVoF zn_XvZ`cGHOz0KMgJ}gDj7?xQ-78PTGw|FM9M3XbwNxnHJftfp$iEV;{v;kuMa_zO~ zFRA?U2 void baz(T t) {} +}; + +#ifdef FILE1 +void foo() { + S s; +} + +// CHECK: TAG_compile_unit +// CHECK-NOT: {{DW_TAG|NULL}} +// CHECK: AT_name{{.*}}"odr-member-functions.cpp" + +// CHECK: 0x[[S:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type +// CHECK-NOT: {{DW_TAG|NULL}} +// CHECK: DW_AT_name{{.*}}"S" +// CHECK-NOT: NULL +// CHECK: 0x[[FOO:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram +// CHECK-NEXT: DW_AT_MIPS_linkage_name{{.*}}"_ZN1S3fooEv" +// CHECK: NULL +// CHECK: 0x[[FOOI:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram +// CHECK-NEXT: DW_AT_MIPS_linkage_name{{.*}}"_ZN1S3fooEi" + +#elif defined(FILE2) +void foo() { + S s; + // Check that the overloaded member functions are resolved correctly + s.foo(); + s.foo(1); +} + +// CHECK: TAG_compile_unit +// CHECK-NOT: DW_TAG +// CHECK: AT_name{{.*}}"odr-member-functions.cpp" + +// Normal member functions should be desribed by the type in the first +// CU, thus we should be able to reuse its definition and avoid +// reemiting it. +// CHECK-NOT: DW_TAG_structure_type + +// CHECK: 0x[[FOO_SUB:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram +// CHECK-NEXT: DW_AT_specification{{.*}}[[FOO]] +// CHECK-NOT: DW_TAG_structure_type +// CHECK: 0x[[FOOI_SUB:[0-9a-f]*]]:{{.*}}DW_TAG_subprogram +// CHECK-NEXT: DW_AT_specification{{.*}}[[FOOI]] +// CHECK-NOT: DW_TAG_structure_type + +// CHECK: DW_TAG_variable +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_name {{.*}}"s" +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_type {{.*}}[[S]]) +// CHECK: DW_TAG_inlined_subroutine +// CHECK-NEXT: DW_AT_abstract_origin{{.*}}[[FOO_SUB]] +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_call_line{{.*}}40 +// CHECK: DW_TAG_inlined_subroutine +// CHECK-NEXT: DW_AT_abstract_origin{{.*}}[[FOOI_SUB]] +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_call_line{{.*}}41 + +#elif defined(FILE3) +void foo() { + S s; + s.baz(42); +} + +// CHECK: TAG_compile_unit +// CHECK-NOT: DW_TAG +// CHECK: AT_name{{.*}}"odr-member-functions.cpp" + +// Template or other implicit members will be included in the type +// only if they are generated. Thus actually creating a new type. +// CHECK: DW_TAG_structure_type + +// Skip 'normal' member functions +// CHECK: DW_TAG_subprogram +// CHECK: DW_TAG_subprogram +// CHECK: DW_TAG_subprogram + +// This is the 'baz' member +// CHECK: 0x[[BAZ:[0-9a-f]*]]: DW_TAG_subprogram +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_MIPS_linkage_name {{.*}}"_ZN1S3bazIiEEvT_" +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_name {{.*}}"baz" + +// Skip foo3 +// CHECK: DW_TAG_subprogram + +// baz instanciation: +// CHECK: DW_TAG_subprogram +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_specification {{.*}}[[BAZ]] "_ZN1S3bazIiEEvT_" +#else +#error "You must define which file you generate" +#endif diff --git a/llvm/test/tools/dsymutil/X86/odr-uniquing.cpp b/llvm/test/tools/dsymutil/X86/odr-uniquing.cpp new file mode 100644 index 000000000000..e1932d41d8a0 --- /dev/null +++ b/llvm/test/tools/dsymutil/X86/odr-uniquing.cpp @@ -0,0 +1,187 @@ +/* Compile with: + clang -g -c odr-uniquing.cpp -o odr-uniquing/1.o + + The aim of these test is to check that all the 'type types' that + should be uniqued through the ODR really are. + + The resulting object file is linked against itself using a fake + debug map. The end result is: + - with ODR uniquing: all types (expect for the union for now) in + the second CU should point back to the types of the first CU. + - without ODR uniquing: all types are re-emited in the second CU + */ + +// RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=ODR -check-prefix=CHECK %s +// RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs/odr-uniquing -y %p/dummy-debug-map.map -no-odr -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=NOODR -check-prefix=CHECK %s + +// The first compile unit contains all the types: +// CHECK: TAG_compile_unit +// CHECK-NOT: DW_TAG +// CHECK: AT_name{{.*}}"odr-uniquing.cpp" + +struct S { + struct Nested {}; +}; + +// CHECK: 0x[[S:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type +// CHECK-NEXT: DW_AT_name{{.*}}"S" +// CHECK-NOT: NULL +// CHECK: 0x[[NESTED:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type +// CHECK-NOT: DW_TAG +// CHECK: DW_AT_name{{.*}}"Nested" +// CHECK: NULL + +namespace N { +class C {}; +} + +// CHECK: DW_TAG_namespace +// CHECK-NEXT: DW_AT_name{{.*}}"N" +// CHECK-NOT: NULL +// CHECK: 0x[[NC:[0-9a-f]*]]:{{.*}}DW_TAG_class_type +// CHECK-NEXT: DW_AT_name{{.*}}"C" +// CHECK: NULL + +union U { + class C {} C; + struct S {} S; +}; + +// CHECK: 0x[[U:[0-9a-f]*]]:{{.*}}DW_TAG_union_type +// CHECK-NEXT: DW_AT_name{{.*}}"U" +// CHECK-NOT: NULL +// CHECK: 0x[[UC:[0-9a-f]*]]:{{.*}}DW_TAG_class_type +// CHECK-NOT: NULL +// CHECK: 0x[[US:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type +// CHECK: NULL + +typedef S AliasForS; + +// CHECK: 0x[[ALIASFORS:[0-9a-f]*]]:{{.*}}DW_TAG_typedef +// CHECK-NEXT: DW_AT_type{{.*}}[[S]] +// CHECK-NEXT: DW_AT_name{{.*}}"AliasForS" + +namespace { +class AnonC {}; +} + +// CHECK: DW_TAG_namespace +// CHECK-NOT: {{DW_AT_name|NULL|DW_TAG}} +// CHECK: 0x[[ANONC:[0-9a-f]*]]:{{.*}}DW_TAG_class_type +// CHECK-NEXT: DW_AT_name{{.*}}"AnonC" + +// This function is only here to hold objects that refer to the above types. +void foo() { + AliasForS s; + S::Nested n; + N::C nc; + AnonC ac; + U u; +} + +// The second CU contents depend on wether we disabled ODR uniquing or +// not. + +// CHECK: TAG_compile_unit +// CHECK-NOT: DW_TAG +// CHECK: AT_name{{.*}}"odr-uniquing.cpp" + +// The union itself is not uniqued for now (for dsymutil-compatibility), +// but the types defined inside it should be. +// ODR: DW_TAG_union_type +// ODR-NEXT: DW_AT_name{{.*}}"U" +// ODR: DW_TAG_member +// ODR-NEXT: DW_AT_name{{.*}}"C" +// ODR-NOT: DW_TAG +// ODR: DW_AT_type{{.*}}[[UC]] +// ODR: DW_TAG_member +// ODR-NEXT: DW_AT_name{{.*}}"S" +// ODR-NOT: DW_TAG +// ODR: DW_AT_type{{.*}}[[US]] + +// Check that the variables point to the right type +// ODR: DW_TAG_subprogram +// ODR-NOT: DW_TAG +// ODR: DW_AT_name{{.*}}"foo" +// ODR-NOT: NULL +// ODR: DW_TAG_variable +// ODR-NOT: DW_TAG +// ODR: DW_AT_name{{.*}}"s" +// ODR-NOT: DW_TAG +// ODR: DW_AT_type{{.*}}[[ALIASFORS]] +// ODR: DW_AT_name{{.*}}"n" +// ODR-NOT: DW_TAG +// ODR: DW_AT_type{{.*}}[[NESTED]] +// ODR: DW_TAG_variable +// ODR-NOT: DW_TAG +// ODR: DW_AT_name{{.*}}"nc" +// ODR-NOT: DW_TAG +// ODR: DW_AT_type{{.*}}[[NC]] +// ODR: DW_TAG_variable +// ODR-NOT: DW_TAG +// ODR: DW_AT_name{{.*}}"ac" +// ODR-NOT: DW_TAG +// ODR: DW_AT_type{{.*}}[[ANONC]] + +// With no ODR uniquing, we should get copies of all the types: + +// This is "struct S" +// NOODR: 0x[[DUP_S:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type +// NOODR-NEXT: DW_AT_name{{.*}}"S" +// NOODR-NOT: NULL +// NOODR: 0x[[DUP_NESTED:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_name{{.*}}"Nested" + +// This is "class N::C" +// NOODR: DW_TAG_namespace +// NOODR-NEXT: DW_AT_name{{.*}}"N" +// NOODR: 0x[[DUP_NC:[0-9a-f]*]]:{{.*}}DW_TAG_class_type +// NOODR-NEXT: DW_AT_name{{.*}}"C" + +// This is "union U" +// NOODR: 0x[[DUP_U:[0-9a-f]*]]:{{.*}}DW_TAG_union_type +// NOODR-NEXT: DW_AT_name{{.*}}"U" +// NOODR-NOT: NULL +// NOODR: 0x[[DUP_UC:[0-9a-f]*]]:{{.*}}DW_TAG_class_type +// NOODR-NOT: NULL +// NOODR: 0x[[DUP_US:[0-9a-f]*]]:{{.*}}DW_TAG_structure_type +// NOODR: NULL + +// Check that the variables point to the right type +// NOODR: DW_TAG_subprogram +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_name{{.*}}"foo" +// NOODR-NOT: NULL +// NOODR: DW_TAG_variable +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_name{{.*}}"s" +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_type{{.*}}0x[[DUP_ALIASFORS:[0-9a-f]*]] +// NOODR: DW_TAG_variable +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_name{{.*}}"n" +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_type{{.*}}[[DUP_NESTED]] +// NOODR: DW_TAG_variable +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_name{{.*}}"nc" +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_type{{.*}}[[DUP_NC]] +// NOODR: DW_TAG_variable +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_name{{.*}}"ac" +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_type{{.*}}0x[[DUP_ANONC:[0-9a-f]*]] + +// This is "AliasForS" +// NOODR: 0x[[DUP_ALIASFORS]]:{{.*}}DW_TAG_typedef +// NOODR-NOT: DW_TAG +// NOODR: DW_AT_name{{.*}}"AliasForS" + +// This is "(anonymous namespace)::AnonC" +// NOODR: DW_TAG_namespace +// NOODR-NOT: {{DW_AT_name|NULL|DW_TAG}} +// NOODR: 0x[[DUP_ANONC]]:{{.*}}DW_TAG_class_type +// NOODR-NEXT: DW_AT_name{{.*}}"AnonC" +